网站首页  词典首页

请输入您要查询的函数:

 

术语 sleepconditionvariablesrw
释义 SleepConditionVariableSRW
语法:
C++
BOOL WINAPI SleepConditionVariableSRW(
__inout PCONDITION_VARIABLE ConditionVariable,
__inout PSRWLOCK SRWLock,
__in DWORD dwMilliseconds,
__in ULONG Flags
);
SleepConditionVariableSRW功能
指定的条件变量,并释放一个原子操作指定的锁定。
参数
ConditionVariable [ in , out ]
一个条件变量的指针。这个变量必须初始化使用InitializeConditionVariable功能。
SRWLock [ in , out ]
一个锁指针。
dwMilliseconds的 [in]
在超时间隔时间,以毫秒为单位。假如该函数返回的时间间隔经过的。如果dwMilliseconds的是零,功能检查指定的对象和国家立即返回。如果dwMilliseconds的是无限的,该函数的超时时间间隔从未经过的。
标志 [in]
如果这个参数是CONDITION_VARIABLE_LOCKMODE_SHARED的软红冬小麦锁共享模式。否则,锁以独占模式。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
如果锁被解锁时,此函数被调用时,函数的行为是不确定的。
该线程被唤醒可以使用WakeConditionVariable或WakeAllConditionVariable功能。
条件变量受(不明确之后,相关的人),假被盗唤醒唤醒(另一个线程之前运行管理的唤醒线程)。因此,您应该重新检查后的谓词睡眠操作返回(通常在while循环)。
要求:
client最低支持Vista
server最低支持 Windows Server 2008
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
轻量级 读/写(SRW)锁
同步功能
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==SleepConditionVariableSRW Function
Sleeps on the specified condition variable and releases the specified lock as an atomic operation.
Syntax
C++
BOOL WINAPI SleepConditionVariableSRW(
__inout PCONDITION_VARIABLE ConditionVariable,
__inout PSRWLOCK SRWLock,
__in DWORD dwMilliseconds,
__in ULONG Flags
);
Parameters
ConditionVariable [in, out]
A pointer to the condition variable. This variable must be initialized using the InitializeConditionVariable function.
SRWLock [in, out]
A pointer to the lock.
dwMilliseconds [in]
The time-out interval, in milliseconds. The function returns if the interval elapses. If dwMilliseconds is zero, the function tests the states of the specified objects and returns immediately. If dwMilliseconds is INFINITE, the function's time-out interval never elapses.
Flags [in]
If this parameter is CONDITION_VARIABLE_LOCKMODE_SHARED, the SRW lock is in shared mode. Otherwise, the lock is in exclusive mode.
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
If the lock is unlocked when this function is called, the function behavior is undefined.
The thread can be woken using the WakeConditionVariable or WakeAllConditionVariable function.
Condition variables are subject to spurious wakeups (those not associated with an explicit wake) and stolen wakeups (another thread manages to run before the woken thread). Therefore, you should recheck a predicate (typically in a while loop) after a sleep operation returns.
Requirements
Minimum supported clientWindows Vista
Minimum supported serverWindows Server 2008
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
Slim Reader/Writer (SRW) Locks
Synchronization Functions
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms686304(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 更新时间:2025/1/8 10:52:50