Pierre d'Herbemont pdherbemont@free.fr writes:
DWORD remaining_timeout = timeout;
DWORD acceptable_timeout;
/* We can't remain too long without a carbon call,
or the application seems to hang for the user */
do {
if(remaining_timeout > 50 || remaining_timeout == INFINITE)
acceptable_timeout = 50;
else
acceptable_timeout = remaining_timeout;
ret = WaitForMultipleObjectsEx( count, handles, flags & MWMO_WAITALL,
acceptable_timeout, flags & MWMO_ALERTABLE );
I don't think polling is an acceptable way to wait for events. You really need to get a file descriptor or some other handle that you can wait on.