Platform SDK: DLLs, Processes, and Threads

UnregisterWaitEx

The UnregisterWaitEx function cancels a registered wait operation issued by the RegisterWaitForSingleObject function.

BOOL UnregisterWaitEx(
  HANDLE WaitHandle,      // wait handle
  HANDLE CompletionEvent  // completion event
);

Parameters

WaitHandle
[in] Wait handle. This handle is returned by the RegisterWaitForSingleObject function.
CompletionEvent
[in] Specifies the event to be signaled when the wait operation has been unregistered.

If this parameter is not INVALID_HANDLE_VALUE, the function is non-blocking; it does not wait for all callback functions to complete. Otherwise, the function returns immediately.

Return Values

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

You cannot make a blocking call to UnregisterWaitEx from within a callback function.

After making non-blocking call, no new callback functions can be queued. However, there may be pending callback functions already queued to worker threads.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Unsupported.
  Header: Declared in Winbase.h; include Windows.h.
  Library: Use Kernel32.lib.

See Also

Synchronization Overview, Synchronization Functions, RegisterWaitForSingleObject, Thread Pooling