summaryrefslogtreecommitdiff
path: root/ACE/ace/WFMO_Reactor.cpp
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2008-11-14 09:41:52 +0000
committerJohnny Willemsen <jwillemsen@remedy.nl>2008-11-14 09:41:52 +0000
commiteaeac78911bded6ecc3af49443b7d0cb54bb503f (patch)
treef09bff7eb4618e00087e5162382dfe41177bbbbb /ACE/ace/WFMO_Reactor.cpp
parentb9b0ad8a9428deedd2cb0d3fc40432c15988a758 (diff)
downloadATCD-eaeac78911bded6ecc3af49443b7d0cb54bb503f.tar.gz
Thu Nov 13 09:41:30 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl>
Diffstat (limited to 'ACE/ace/WFMO_Reactor.cpp')
-rw-r--r--ACE/ace/WFMO_Reactor.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/ACE/ace/WFMO_Reactor.cpp b/ACE/ace/WFMO_Reactor.cpp
index b2f849ae3ad..bae271f850a 100644
--- a/ACE/ace/WFMO_Reactor.cpp
+++ b/ACE/ace/WFMO_Reactor.cpp
@@ -1756,9 +1756,12 @@ ACE_WFMO_Reactor::ok_to_wait (ACE_Time_Value *max_wait_time,
// 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_Time_Value timeout = ACE_OS::gettimeofday ();
+ ACE_Time_Value timeout;
if (max_wait_time != 0)
- timeout += *max_wait_time;
+ {
+ timeout = ACE_OS::gettimeofday ();
+ timeout += *max_wait_time;
+ }
while (1)
{
int status;
@@ -1773,14 +1776,15 @@ ACE_WFMO_Reactor::ok_to_wait (ACE_Time_Value *max_wait_time,
if (max_wait_time == 0)
status = this->lock_.acquire ();
else
- status = this->lock_.acquire (timeout);
+ {
+ 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.
- ACE_Time_Value poll_it = ACE_OS::gettimeofday ();
- if (this->ok_to_wait_.wait (&poll_it) == 0)
+ if (this->ok_to_wait_.wait (&ACE_Time_Value::zero, 0) == 0)
break;
this->lock_.release ();
}
@@ -1899,10 +1903,8 @@ ACE_WFMO_Reactor::expire_timers (void)
int
ACE_WFMO_Reactor::dispatch (DWORD wait_status)
{
- int handlers_dispatched = 0;
-
// Expire timers
- handlers_dispatched += this->expire_timers ();
+ int handlers_dispatched = this->expire_timers ();
switch (wait_status)
{
@@ -1937,7 +1939,7 @@ ACE_WFMO_Reactor::dispatch_handles (DWORD wait_status)
DWORD dispatch_slot = 0;
// Cache this value, this is the absolute value.
- DWORD max_handlep1 = this->handler_rep_.max_handlep1 ();
+ DWORD const max_handlep1 = this->handler_rep_.max_handlep1 ();
// nCount starts off at <max_handlep1>, this is a transient count of
// handles last waited on.
@@ -2215,7 +2217,7 @@ ACE_WFMO_Reactor::upcall (ACE_Event_Handler *event_handler,
}
}
- if (ACE_BIT_ENABLED (actual_events, FD_ACCEPT))
+ if (ACE_BIT_ENABLED (actual_events, FD_ACCEPT))
{
action = event_handler->handle_input (io_handle);
if (action <= 0)