views:

773

answers:

1

Example

System.Threading.AutoResetEvent e = new System.Threading.AutoResetEvent(false);
bool b = e.WaitOne(1000, false);

I've done a lot of multi threaded development in my time and have always wondered what the use of the that method was for. The second boolean parameter on the WaitOne is called exitContext. MS Help states "true to exit the synchronization domain for the context before the wait (if in a synchronized context), and reacquire it afterward; otherwise, false."

Anyone any idea what this means? Is it something I should be worried about?

Kind Regards Noel

+3  A: 

I can't claim credit (hence wiki) but there is a good answer here.

Marc Gravell
Thanks for the Link Marc, explains it perfectly.
Bigtoe