WaitHandle.WaitAny to match WaitForMultipleObjects functionality

后端 未结 3 1592
情深已故
情深已故 2021-01-19 01:04

I am porting C++ API code to .NET and looking into function call WaitHandle.WaitAny as a replacement for WaitForMultipleObjects<

3条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-19 01:49

    It is true that WaitHandle.WaitAny() is not quite enough to match the functionality of WaitForMultipleObjects(). But you just need to use WaitHandle.WaitAll() as well.

    • WaitHandle.WaitAny() matches WaitForMultipleObjects() called with the WaitAll parameter set to FALSE,.
    • WaitHandle.WaitAll() matches it with WaitAll set to TRUE.

提交回复
热议问题