Поделиться через


ISchedulerProxy::BindContext Method

Associates an execution context with a thread proxy, if it is not already associated with one.

virtual void BindContext(
   IExecutionContext * pContext
) =0;

Parameters

  • pContext
    An interface to the execution context to associate with a thread proxy.

Remarks

Normally, the IThreadProxy::SwitchTo method will bind a thread proxy to an execution context on demand. There are, however, circumstances where it is necessary to bind a context in advance to ensure that the SwitchTo method switches to an already bound context. This is the case on a UMS scheduling context as it cannot call methods that allocate memory, and binding a thread proxy may involve memory allocation if a thread proxy is not readily available in the free pool of the thread proxy factory.

invalid_argument is thrown if the parameter pContext has the value NULL.

Requirements

Header: concrtrm.h

Namespace: Concurrency

See Also

Reference

ISchedulerProxy Structure

ISchedulerProxy::UnbindContext Method