ntdll: Use condition variable for RtlQueueWorkItem implementation

Alexandre Julliard julliard at winehq.org
Tue Mar 11 09:09:12 CDT 2014

Sebastian Lackner <sebastian at fds-team.de> writes:

> * Its also on purpose, that num_workers is (read-) accessed at one point
> without locking the critical section. If num_workers > 0 we can be sure, that
> a worker thread will process the work item (sooner or later). If
> num_workers == 0 we enter the critical section, and check once more to
> prevent race condition 2.

The worker may be about to exit at the time you check. I don't think it
makes any sense to add races to "optimize" an error case that's not
going to happen anyway.

Alexandre Julliard
julliard at winehq.org

More information about the wine-devel mailing list