网站首页  词典首页

请输入您要查询的函数:

 

术语 pulseevent
释义 PulseEvent
语法:
C++
BOOL WINAPI PulseEvent(
__in HANDLE hEvent
);
PulseEvent功能
设置指定事件对象的信号状态,然后重置到无信号状态后,释放出适当数量的等待线程。
注意:此功能是靠不住的,不应使用。它的存在主要是为了向后兼容。有关更多信息,请参见备注。
参数
hEvent [in]
阿处理该事件的对象。在CreateEvent或OpenEvent函数返回此句柄。
句柄必须有EVENT_MODIFY_STATE访问权限。有关更多信息,请参阅同步对象的安全和访问权限。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
线程同步对象上等待,可以暂时免去等待状态的内核模式APC,然后返回后,装甲运兵车在等待状态完成。如果对PulseEvent期间可当线程已经从拆除的时间等待状态时,该线程将不会被释放,因为只有那些PulseEvent释放线程是在它被称为等待时机。因此,PulseEvent是不可靠的,应该不会有新的应用程序使用。相反,使用条件变量。
对于手动重置事件对象,所有的等待,可以立即释放被释放线程。然后函数重置事件对象的状态,无信号和回报。
对于一个自动重置事件对象,功能重置状态,无信号,并返回后释放一个等待的线程,即使多个线程正在等待。
如果没有线程在等待,或者如果没有线程可以被立即释放,PulseEvent简单的设置事件对象的状态,无信号和回报。
请注意,对于使用多线程对象等待函数等待所有指定的对象被信号,PulseEvent可以设置事件对象的状态的信号并将其重置为无信号而不会导致等待函数返回。出现这种情况如果没有指定的所有对象都同时发出信号。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
CreateEvent
事件对象
OpenEvent
ResetEvent
SetEvent
同步功能
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==PulseEvent Function
Sets the specified event object to the signaled state and then resets it to the nonsignaled state after releasing the appropriate number of waiting threads.
Note This function is unreliable and should not be used. It exists mainly for backward compatibility. For more information, see Remarks.
Syntax
C++
BOOL WINAPI PulseEvent(
__in HANDLE hEvent
);
Parameters
hEvent [in]
A handle to the event object. The CreateEvent or OpenEvent function returns this handle.
The handle must have the EVENT_MODIFY_STATE access right. For more information, see Synchronization Object Security and Access Rights .
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
A thread waiting on a synchronization object can be momentarily removed from the wait state by a kernel-mode APC, and then returned to the wait state after the APC is complete. If the call to PulseEvent occurs during the time when the thread has been removed from the wait state, the thread will not be released because PulseEvent releases only those threads that are waiting at the moment it is called. Therefore, PulseEvent is unreliable and should not be used by new applications. Instead, use condition variables .
For a manual-reset event object, all waiting threads that can be released immediately are released. The function then resets the event object's state to nonsignaled and returns.
For an auto-reset event object, the function resets the state to nonsignaled and returns after releasing a single waiting thread, even if multiple threads are waiting.
If no threads are waiting, or if no thread can be released immediately, PulseEvent simply sets the event object's state to nonsignaled and returns.
Note that for a thread using the multiple-object wait functions to wait for all specified objects to be signaled, PulseEvent can set the event object's state to signaled and reset it to nonsignaled without causing the wait function to return. This happens if not all of the specified objects are simultaneously signaled.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
CreateEvent
Event Objects
OpenEvent
ResetEvent
SetEvent
Synchronization Functions
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms684914(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:59