diff options
author | Erik Sohns <erik.sohns@posteo.de> | 2023-04-05 17:37:54 +0200 |
---|---|---|
committer | Erik Sohns <erik.sohns@posteo.de> | 2023-04-05 17:37:54 +0200 |
commit | 761e24b54d7fda41ed58a6e2f41ba905e43bf3d9 (patch) | |
tree | 69171a8ba215e125cf273ab6bbe4641313df6e6a /ACE/ace/WFMO_Reactor.cpp | |
parent | 3e44fb91cf724aeb48b38169482a4878de316afc (diff) | |
parent | 9e18d338ec598e1a8da6d32a0fba5a20c76978f7 (diff) | |
download | ATCD-761e24b54d7fda41ed58a6e2f41ba905e43bf3d9.tar.gz |
Merge branch 'message_queue_ex_get_queue' of https://github.com/esohns/ACE_TAO into message_queue_ex_get_queue
Diffstat (limited to 'ACE/ace/WFMO_Reactor.cpp')
-rw-r--r-- | ACE/ace/WFMO_Reactor.cpp | 51 |
1 files changed, 2 insertions, 49 deletions
diff --git a/ACE/ace/WFMO_Reactor.cpp b/ACE/ace/WFMO_Reactor.cpp index 30f664ba6ab..f5cd8859ebb 100644 --- a/ACE/ace/WFMO_Reactor.cpp +++ b/ACE/ace/WFMO_Reactor.cpp @@ -1758,48 +1758,7 @@ ACE_WFMO_Reactor::ok_to_wait (ACE_Time_Value *max_wait_time, // will not be able to dispatch it // We need to wait for both the <lock_> and <ok_to_wait_> event. - // If not on WinCE, use WaitForMultipleObjects() to wait for both atomically. - // On WinCE, the waitAll arg to WFMO must be false, so wait for the - // ok_to_wait_ event first (since that's likely to take the longest) then - // grab the lock and recheck the ok_to_wait_ event. When we can get them - // both, or there's an error/timeout, return. -#if defined (ACE_HAS_WINCE) - ACE_UNUSED_ARG (alertable); - ACE_Time_Value timeout; - if (max_wait_time != 0) - { - timeout = ACE_OS::gettimeofday (); - timeout += *max_wait_time; - } - while (1) - { - int status; - if (max_wait_time == 0) - status = this->ok_to_wait_.wait (); - else - status = this->ok_to_wait_.wait (&timeout); - if (status == -1) - return -1; - // The event is signaled, so it's ok to wait; grab the lock and - // recheck the event. If something has changed, restart the wait. - if (max_wait_time == 0) - status = this->lock_.acquire (); - else - { - status = this->lock_.acquire (timeout); - } - if (status == -1) - return -1; - - // Have the lock_, now re-check the event. If it's not signaled, - // another thread changed something so go back and wait again. - if (this->ok_to_wait_.wait (&ACE_Time_Value::zero, 0) == 0) - break; - this->lock_.release (); - } - return 1; - -#else + // Use WaitForMultipleObjects() to wait for both atomically. int timeout = max_wait_time == 0 ? INFINITE : max_wait_time->msec (); DWORD result = 0; while (1) @@ -1843,7 +1802,6 @@ ACE_WFMO_Reactor::ok_to_wait (ACE_Time_Value *max_wait_time, // It is ok to enter ::WaitForMultipleObjects return 1; -#endif /* ACE_HAS_WINCE */ } DWORD @@ -1854,7 +1812,7 @@ ACE_WFMO_Reactor::wait_for_multiple_events (int timeout, // If <alertable> is enabled allow asynchronous completion of // ReadFile and WriteFile operations. -#if defined (ACE_HAS_PHARLAP) || defined (ACE_HAS_WINCE) +#if defined (ACE_HAS_PHARLAP) // PharLap doesn't do async I/O and doesn't implement // WaitForMultipleObjectsEx, so use WaitForMultipleObjects. ACE_UNUSED_ARG (alertable); @@ -1920,16 +1878,11 @@ ACE_WFMO_Reactor::dispatch (DWORD wait_status) case WAIT_FAILED: // Failure. ACE_OS::set_errno_to_last_error (); return -1; - case WAIT_TIMEOUT: // Timeout. errno = ETIME; return handlers_dispatched; - -#ifndef ACE_HAS_WINCE case WAIT_IO_COMPLETION: // APC. return handlers_dispatched; -#endif // ACE_HAS_WINCE - default: // Dispatch. // We'll let dispatch worry about abandoned mutes. handlers_dispatched += this->dispatch_handles (wait_status); |