Share via


CurrentScheduler::Detach Method

Detaches the current scheduler from the calling context and restores the previously attached scheduler as the current scheduler, if one exists. After this method returns, the calling context is then managed by the scheduler that was previously attached to the context via either the CurrentScheduler::Create or Scheduler::Attach method.

_CRTIMP static void __cdecl Detach();

Remarks

The Detach method implicitly removes a reference count from the scheduler.

If there is no scheduler attached to the calling context, calling this method will result in an improper_scheduler_detach exception being thrown.

Requirements

Header: concrt.h

Namespace: Concurrency

See Also

Reference

CurrentScheduler Class

Scheduler::Attach Method

CurrentScheduler::Create Method