IServiceActivity::UnbindFromThread method (comsvcs.h)

Unbinds the user-defined batch work from the thread on which it is running.

Syntax

HRESULT UnbindFromThread();

Return value

This method can return the standard return values E_INVALIDARG, E_OUTOFMEMORY, E_FAIL, and S_OK.

Remarks

This method unbinds the batch work that is submitted through the AsynchronousCall or the SynchronousCall method from the thread it is running on. It has no effect if the batch work was not previously bound to a thread.

Calling this method is equivalent to having called IServiceThreadPoolConfig::SetBindingInfo with CSC_NoBinding on the CServiceConfig object that was passed through the pIUnknown parameter to CoCreateActivity. However, after the activity has been created by CoCreateActivity, you can no longer call IServiceThreadPoolConfig::SetBindingInfo to change the thread binding. To change the thread binding after the activity has been created, you must call the BindToCurrentThread or the UnbindFromThread method of IServiceActivity.

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header comsvcs.h

See also

IServiceActivity