How program block avoid race condition