The documentation for RegisterWaitForSingleObject says
Using a Mutex for waitObject does not
provide mutual exclusion for the
callbacks because the underlying Win32
API uses the default WT_EXECUTEDEFAULT
flag, so each callback is dispatched
on a separate thread pool thread.
Instead of a Mutex, use a Semaphore
with a maximum count of 1.
and (in the documentation for the WaitHandle argument) it says
Use a WaitHandle other than Mutex
This seems to imply that it’s safe to use an Event — is it?
Would there be any difference between using an AutoResetEvent and a ManualResetEvent?
Events are fine. I think I’ve only ever used events with this method
Re auto vs. manual reset events, the documentation for the underlying Win32 API says that only the object that signalled the end of the wait is affected:
Manual reset events never change state unless you do it, well, manually; I’d expect an auto reset event to reset itself only if it was the one that caused the wait to finish. You would only notice this if you had two auto-reset events signalled simultaneously.