CLUS_WORKER structure

Contains information about a worker thread.

Syntax

typedef struct CLUS_WORKER {
  HANDLE hThread;
  BOOL   Terminate;
} CLUS_WORKER, *PCLUS_WORKER;

Members

hThread

Handle to the worker thread.

Terminate

Flag that indicates whether the thread is to be terminated.

Remarks

A worker thread is a thread that is created to offload work from a main thread so that the main thread is not blocked.

A CLUS_WORKER structure is returned as output from ClusWorkerCreate and passed as input to ClusWorkerCheckTerminate and ClusWorkerTerminate. There is never any reason for an application or resource DLL to alter the members of a CLUS_WORKER structure. This structure should always be treated as read-only.

The Terminate member prevents a potential race condition that can occur if multiple threads call the ClusWorkerTerminate function to end the same worker thread. The first call sets Terminate to TRUE. Subsequent calls return immediately after checking the value of Terminate without waiting for the thread to exit.

Requirements

   
Minimum supported client None supported
Minimum supported server Windows Server 2008 Enterprise, Windows Server 2008 Datacenter
Header resapi.h

See Also

ClusWorkerCheckTerminate

ClusWorkerCreate

ClusWorkerTerminate