Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I tell if a ManualResetEvent is signaled or non-signaled?

Tags:

c#

I want to check to see if an instance of ManualResetEvent is signaled before starting a thread. How can I do this?

like image 390
user363061 Avatar asked Jun 10 '10 03:06

user363061


1 Answers

You can use WaitOne with a timeout of zero. Either way, the function will return immediately and you can use the return value to determine whether the event was signalled or not.

like image 190
Dean Harding Avatar answered Oct 28 '22 19:10

Dean Harding