It will cause an AbandonedMutexException
. The correct way of using this class is not to call close while waiters are active.
.NET EventWaitHandle signal all threads
-
16-01-2022 - |
Domanda
Will close()
signal all the threads
that have called WaitOne()
?
If not, what's the best way to do this?
Soluzione 2
Altri suggerimenti
No. It will cause the WaitOne() method to fail with an exception, ObjectDisposedException in particular.
The only "best way" is to not do this, it is a plain bug. EventWaitHandle objects should only ever be closed or disposed when they are no longer used.
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow