ClusWorkerTerminateEx function (resapi.h)

Waits for a worker thread 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 ClusWorkerTerminateEx(
  [in, out] PCLUS_WORKER ClusWorker,
  [in]      DWORD        TimeoutInMilliseconds,
  [in]      BOOL         WaitOnly
);

Parameters

[in, out] ClusWorker

Pointer to a CLUS_WORKER structure describing the worker thread to terminate.

[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

Returns a system error code on failure.

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

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

ClusWorkersTerminate

Thread Management Utility Functions