Am 22.08.2020 um 02:44 schrieb Martin via fpc-devel:
I am tracing a race condition in lazCollections TLazThreadedQueue
on win-64

What is supposed to happen in the following case:

2 or more threads are waiting on the some event
  RTLeventWaitFor(UniqueEvent)

1 thread sets it
  RTLeventSetEvent(UniqueEvent)

I expect that wakes up exactly ONE thread (never mind wich)?
Or ALL?

If no one resets the event (NO call to RTLeventResetEvent), then that does not change anything? It is still just the one thread that got woken up?

On Windows these are direct calls to the WinAPI functions WaitForSingleObject and SetEvent (and the created event is an Auto Reset Event), so you should probably take a look at the MSDN documentation for them...

Regards,
Sven
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to