within
DoWork()
I callAutoResetEvent.WaitOne()
. Does this stop the current thread untilAutoResetEvent.Set()
is called? If for example,AutoResetEvent.Set()
is never called will theBackground Worker
simply halt and not perform any operations?
The answer to this is yes as cited from MSDN WaitHandle.WaitOne Method
will:
Blocks the current thread until the current WaitHandle receives a signal.
EDIT: for your added code, the while loop will wait for the Set()