Table of Contents
WaitableTask.GetDoneEvent Method ()

Returns a WaitHandle object that will be signaled when the task completes.

Syntax
 public WaitHandle GetDoneEvent();
Remarks

This method returns a WaitHandle object that can be waited on for the task to complete. However you should only wait on the returned WaitHandle from a worker thread. Waiting on the handle from the UI thread will stop the message flow thus potentially causing a deadlock. For this reason, this method raises an exception if called from the UI thread. To avoid this exception, you can call GetDoneEvent and pass false to the checkThread argument.

See Also