Export (0) Print
Expand All

task_completion_event::set Method

Sets the task completion event.

bool set(
   _ResultType _Result
) const ;

bool set() const ;

_Result

The result to set this event with.

The method returns true if it was successful in setting the event. It returns false if the event is already set.

In the presence of multiple or concurrent calls to set, only the first call will succeed and its result (if any) will be stored in the task completion event. The remaining sets are ignored and the method will return false. When you set a task completion event, all the tasks created from that event will immediately complete, and its continuations, if any, will be scheduled. Task completion objects that have a _ResultType other than void will pass the value to their continuations.

Header: ppltasks.h

Namespace: concurrency

Show:
© 2014 Microsoft