网站首页  词典首页

请输入您要查询的函数:

 

术语 unregisterwaitex
释义 UnregisterWaitEx
语法:
C++
BOOL WINAPI UnregisterWaitEx(
__in HANDLE WaitHandle,
__in_opt HANDLE CompletionEvent
);
UnregisterWaitEx功能
取消注册等操作功能的RegisterWaitForSingleObject发出。
参数
WaitHandle中 [in]
在等待处理。这种处理是由RegisterWaitForSingleObject函数返回。
CompletionEvent [中,可选]
句柄的事件对象时,要等待信号操作已被取消注册。此参数可以为NULL。
如果此参数为INVALID_HANDLE_VALUE,函数等待返回之前完成所有回调函数。
如果该参数为NULL,函数标记为删除,并立即返回计时器。然而,大多数来电者应等待回调函数来完成,使他们能够执行任何所需的清理工作。
如果调用方提供这一事件和功能的ERROR_IO_PENDING失败,不要关闭,直到它发出信号的事件。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
您不能阻塞调用UnregisterWaitEx从一个回调函数相同的等待操作。否则,等待回调将是为自己完成。一般来说,一个阻塞调用UnregisterWaitEx之间创建一个当前线程和回调的依赖,所以就再等待操作阻塞注销通话,您必须确保回调函数不上互相依赖,而第二个等待操作不能同时执行的第一个操作调用一个阻塞注销。
决策时要小心在永久线程阻塞UnregisterWaitEx电话。如果等待操作并非注册创造了与WT_EXECUTEINPERSISTENTTHREAD,可能会发生死锁。
后,非阻塞调用UnregisterWaitEx,没有新的回调与WaitHandle中相关的功能都可以排队。不过,有可能已经排队等待工作线程回调函数。
在某些情况下,该函数将失败,ERROR_IO_PENDING如果CompletionEvent为NULL。这表明,有杰出的回调函数。这些回调也将执行或在执行中的。
要编译的应用程序使用此功能,定义_WIN32_WINNT为0x0500或更高版本。有关详细信息,请参阅使用Windows头。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
RegisterWaitForSingleObject
同步功能
线程池
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==UnregisterWaitEx Function
Cancels a registered wait operation issued by the RegisterWaitForSingleObject function.
Syntax
C++
BOOL WINAPI UnregisterWaitEx(
__in HANDLE WaitHandle,
__in_opt HANDLE CompletionEvent
);
Parameters
WaitHandle [in]
The wait handle. This handle is returned by the RegisterWaitForSingleObject function.
CompletionEvent [in, optional]
A handle to the event object to be signaled when the wait operation has been unregistered. This parameter can be NULL.
If this parameter is INVALID_HANDLE_VALUE, the function waits for all callback functions to complete before returning.
If this parameter is NULL, the function marks the timer for deletion and returns immediately. However, most callers should wait for the callback function to complete so they can perform any needed cleanup.
If the caller provide this event and the function fails with ERROR_IO_PENDING, do not close the event until it is signaled.
Return Value
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 for the same wait operation. Otherwise, the callback will be waiting for itself to finish. In general, a blocking call to UnregisterWaitEx creates a dependency between the current thread and the callback, so to make a blocking unregister call on another wait operation, you must ensure that the callback functions do not depend on one another and that the second wait operation does not also perform a blocking unregister call on the first operation.
Be careful when making a blocking UnregisterWaitEx call on a persistent thread. If the wait operation being unregistered was created with WT_EXECUTEINPERSISTENTTHREAD, a deadlock may occur.
After making non-blocking call to UnregisterWaitEx, no new callback functions associated with WaitHandle can be queued. However, there may be pending callback functions already queued to worker threads.
Under some conditions, the function will fail with ERROR_IO_PENDING if CompletionEvent is NULL. This indicates that there are outstanding callback functions. Those callbacks either will execute or are in the middle of executing.
To compile an application that uses this function, define _WIN32_WINNT as 0x0500 or later. For more information, see Using the Windows Headers .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
RegisterWaitForSingleObject
Synchronization Functions
Thread Pooling
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms686876(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:21:58