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


CWorkerThread::Initialize

Call this method to initialize the worker thread.

HRESULT Initialize( ) throw( ); 
HRESULT Initialize(
   CWorkerThread< ThreadTraits > * pThread 
) throw( );

Параметры

  • pThread
    An existing worker thread.

Возвращаемое значение

Returns S_OK on success, or an error HRESULT on failure.

Заметки

This method should be called to initialize the object after creation or after a call to CWorkerThread::Shutdown.

To have two or more CWorkerThread objects use the same worker thread, initialize one of them without passing any arguments then pass a pointer to that object to the Initialize methods of the others. The objects initialized using the pointer should be shut down before the object used to initialize them.

See CWorkerThread::Shutdown for information on how that method's behavior changes when initialized using a pointer to an existing object.

Требования

Header: atlutil.h

См. также

Основные понятия

CWorkerThread Class

CWorkerThread Members