开发者

Difference between KeWaitForSingleObject with 0 timeout and KeReadStateSemaphore

开发者 https://www.devze.com 2023-03-13 07:19 出处:网络
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

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

精彩评论

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