[英].NET EventWaitHandle signal all threads
Will close()
signal all the threads
that have called WaitOne()
? close()
发出信号通知所有已调用WaitOne()
的threads
吗?
If not, what's the best way to do this? 如果没有,执行此操作的最佳方法是什么?
No. It will cause the WaitOne() method to fail with an exception, ObjectDisposedException in particular. 不会。这将导致WaitOne()方法失败,并抛出异常,尤其是ObjectDisposedException。
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.
仅当不再使用EventWaitHandle对象时,才应将其关闭或处置。
It will cause an AbandonedMutexException
. 这将导致
AbandonedMutexException
。 The correct way of using this class is not to call close while waiters are active. 使用此类的正确方法是在服务员处于活动状态时不要调用close。
See http://msdn.microsoft.com/en-us/library/58195swd.aspx 请参阅http://msdn.microsoft.com/en-us/library/58195swd.aspx
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.