ClusWorkersTerminate function (resapi.h)

Waits for multiple worker threads to terminate up to the specified timeout. This function can signal the thread to terminate before wait starts, or just wait passively if specified.

Syntax

DWORD ClusWorkersTerminate(
  [in, out] PCLUS_WORKER *ClusWorkers,
  [in]      size_t const ClusWorkersCount,
  [in]      DWORD        TimeoutInMilliseconds,
  [in]      BOOL         WaitOnly
);

Parameters

[in, out] ClusWorkers

Pointer to an array of CLUS_WORKER structures describing the threads to terminate.

[in] ClusWorkersCount

The number of structures in the ClusWorkers parameter.

[in] TimeoutInMilliseconds

The timeout in milliseconds.

[in] WaitOnly

If set TRUE, the function will wait for up to specified timeout without signaling the thread to terminate; otherwise it will signal the thread to terminate before waiting for the thread.

Return value

Return code Description
ERROR_SUCCESS
All worker threads are terminated.
WAIT_TIMEOUT
At least one worker thread is not terminated within the specified timeout.
 

Returns a system error code on failure.

Requirements

Requirement Value
Minimum supported client None supported
Minimum supported server Windows Server 2016
Target Platform Windows
Header resapi.h
Library ResUtils.lib
DLL ResUtils.dll

See also

CLUS_WORKER

ClusWorkerCheckTerminate

ClusWorkerCreate

ClusWorkerTerminate

ClusWorkerTerminateEx

Thread Management Utility Functions