I am porting C++ API
code to .NET
and looking into function call WaitHandle.WaitAny
as a replacement for WaitForMultipleObjects
but when debugging with .NET4
i can see that this function is hooked into
private static extern int WaitMultiple(
WaitHandle[] waitableSafeHandle,
int msTimeOut,
bool exitContext,
bool WaitAll);
and this makes me think that this function is not sutable for the port. Any other suggestions?
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
.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With