CLUS_WORKER

The CLUS_WORKER structure contains information about a worker thread. The CLUS_WORKER structure is defined in RESAPI.H.

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

Members

hThread
Handle to the worker thread.
Terminate
Flag that indicates whether or not 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.

Applications and resource DLLs work with the CLUS_WORKER structure through the following utility functions:

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 if it were 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 will set Terminate to TRUE. The second call will return immediately after checking the value of Terminate without waiting for the thread to exit.

QuickInfo

  Version: Use Windows NT Server Enterprise Edition 4.0.
  Windows CE: Unsupported.
  Header: Declared in clusapi.h.