win32 race condition fix