TOCTOU has always been a problem with environment manipulation in the presence of threads. Even the shadow environment doesn't have this guarantee because you could have been suspended between the unlock and the return while another thread has its fun with the environment.
↧