On Tue, 21 Mar 2006 03:38:14 -0800, juli jul wrote:
How can I know that the Manual Reset Event object done WaitOne(). I have
a condition and I want to do Set() to Manual Reset Event in it but I
have to know that there WaitOne() was done on it before. How can I know
that?
Why would you want to know that? The whole point of a manual reset event is
that once it has been set, it remains in that state until you manually
reset it. So it doesn't matter whether some other thread has called WaitOne
or not. When you're done with whatever task needs to be completed before
other thread can carry on with their work, just call Set(). If there was
other threads waiting, they will be realeased. If other threads arrive
later and call WaitOne(), they won't block since your ManualResetEvent has
already been signaled.