开发者

Difference between KeWaitForSingleObject with 0 timeout and KeReadStateSemaphore

Is there any difference between KeWaitForSingleObject with timeout set t开发者_JAVA百科o 0 and KeReadStateSemaphore?


There is a very big difference. While KeReadStateSemaphore simply returns the state of the semaphore, KeWaitForSingleObject with a timeout of 0 will actually process side-effects should the wait be satisfied (i.e. the side-effect is to decrement the signal state). Use the former to poll, and use the latter to try to acquire a semaphore without waiting.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜