summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog23
-rw-r--r--ChangeLogs/ChangeLog-02a23
-rw-r--r--ChangeLogs/ChangeLog-03a23
-rw-r--r--ace/OS.i17
-rw-r--r--ace/WFMO_Reactor.cpp32
-rw-r--r--ace/config-sunos5.6.h2
6 files changed, 113 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 917bfcf57c9..4c92dbc5cc2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,26 @@
+Tue Jul 10 18:15:39 2001 Steve Huston <shuston@riverace.com>
+
+ * ace/WFMO_Reactor.cpp (event_handling): Move the logic for
+ noticing that the wait timed out, but did not expire any
+ timers, into this function. Will remove it from Reactor.cpp,
+ to properly move the fix into handle_events() rather than
+ needing to call run_reactor_event_loop to get it right.
+ * ace/Select_Reactor_T.cpp - still need to add similar logic here.
+
+ * ace/config-sunos5.6.h: Re the following:
+ Mon Jul 2 15:26:32 2001 Nanbor Wang <nanbor@cs.wustl.edu>
+ Replaced ACE_HAS_POSIX_SEM, and left ACE_LACKS_NAMED_POSIX_SEM out.
+ Solaris does indeed have POSIX semaphores in 2.6 and later, but
+ requires the changes to OS.i below to work right.
+
+ * ace/OS.h: For ACE_PROC_PRI_OTHER_MIN (and MAX), on HP-UX,
+ convert the HP-UX priority value to the POSIX range.
+
+ * ace/OS.i (ACE_OS::sema_init, named POSIX semaphore): On Solaris
+ and HP-UX, the name of a POSIX semaphore needs to start with
+ a slash (further restricted on Solaris). Enforce that here by
+ prepending a slash, or by chopping off parts of the name.
+
Tue Jul 10 16:08:04 2001 Krishnakumar B <kitty@cs.wustl.edu>
* include/makeinclude/platform_osf1_4.0.GNU:
diff --git a/ChangeLogs/ChangeLog-02a b/ChangeLogs/ChangeLog-02a
index 917bfcf57c9..4c92dbc5cc2 100644
--- a/ChangeLogs/ChangeLog-02a
+++ b/ChangeLogs/ChangeLog-02a
@@ -1,3 +1,26 @@
+Tue Jul 10 18:15:39 2001 Steve Huston <shuston@riverace.com>
+
+ * ace/WFMO_Reactor.cpp (event_handling): Move the logic for
+ noticing that the wait timed out, but did not expire any
+ timers, into this function. Will remove it from Reactor.cpp,
+ to properly move the fix into handle_events() rather than
+ needing to call run_reactor_event_loop to get it right.
+ * ace/Select_Reactor_T.cpp - still need to add similar logic here.
+
+ * ace/config-sunos5.6.h: Re the following:
+ Mon Jul 2 15:26:32 2001 Nanbor Wang <nanbor@cs.wustl.edu>
+ Replaced ACE_HAS_POSIX_SEM, and left ACE_LACKS_NAMED_POSIX_SEM out.
+ Solaris does indeed have POSIX semaphores in 2.6 and later, but
+ requires the changes to OS.i below to work right.
+
+ * ace/OS.h: For ACE_PROC_PRI_OTHER_MIN (and MAX), on HP-UX,
+ convert the HP-UX priority value to the POSIX range.
+
+ * ace/OS.i (ACE_OS::sema_init, named POSIX semaphore): On Solaris
+ and HP-UX, the name of a POSIX semaphore needs to start with
+ a slash (further restricted on Solaris). Enforce that here by
+ prepending a slash, or by chopping off parts of the name.
+
Tue Jul 10 16:08:04 2001 Krishnakumar B <kitty@cs.wustl.edu>
* include/makeinclude/platform_osf1_4.0.GNU:
diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a
index 917bfcf57c9..4c92dbc5cc2 100644
--- a/ChangeLogs/ChangeLog-03a
+++ b/ChangeLogs/ChangeLog-03a
@@ -1,3 +1,26 @@
+Tue Jul 10 18:15:39 2001 Steve Huston <shuston@riverace.com>
+
+ * ace/WFMO_Reactor.cpp (event_handling): Move the logic for
+ noticing that the wait timed out, but did not expire any
+ timers, into this function. Will remove it from Reactor.cpp,
+ to properly move the fix into handle_events() rather than
+ needing to call run_reactor_event_loop to get it right.
+ * ace/Select_Reactor_T.cpp - still need to add similar logic here.
+
+ * ace/config-sunos5.6.h: Re the following:
+ Mon Jul 2 15:26:32 2001 Nanbor Wang <nanbor@cs.wustl.edu>
+ Replaced ACE_HAS_POSIX_SEM, and left ACE_LACKS_NAMED_POSIX_SEM out.
+ Solaris does indeed have POSIX semaphores in 2.6 and later, but
+ requires the changes to OS.i below to work right.
+
+ * ace/OS.h: For ACE_PROC_PRI_OTHER_MIN (and MAX), on HP-UX,
+ convert the HP-UX priority value to the POSIX range.
+
+ * ace/OS.i (ACE_OS::sema_init, named POSIX semaphore): On Solaris
+ and HP-UX, the name of a POSIX semaphore needs to start with
+ a slash (further restricted on Solaris). Enforce that here by
+ prepending a slash, or by chopping off parts of the name.
+
Tue Jul 10 16:08:04 2001 Krishnakumar B <kitty@cs.wustl.edu>
* include/makeinclude/platform_osf1_4.0.GNU:
diff --git a/ace/OS.i b/ace/OS.i
index 44dd162cabb..c93513361b9 100644
--- a/ace/OS.i
+++ b/ace/OS.i
@@ -3523,6 +3523,23 @@ ACE_OS::sema_init (ACE_sema_t *s,
#else
if (name)
{
+#if defined (sun) || defined (HPUX)
+ // Solaris and HP-UX require the name to start with a slash. Solaris
+ // further requires that there be no other slashes than the first.
+ const char *last_slash = ACE_OS::strrchr (name, '/');
+ char name2[MAXPATHLEN];
+ if (0 == last_slash)
+ {
+ ACE_OS::strcpy (name2, "/");
+ ACE_OS::strcat (name2, name);
+ name = name2;
+ }
+# if defined (sun)
+ else
+ name = last_slash; // Chop off chars preceding last slash
+# endif /* sun */
+#endif /* sun || HPUX */
+
ACE_ALLOCATOR_RETURN (s->name_,
ACE_OS::strdup (name),
-1);
diff --git a/ace/WFMO_Reactor.cpp b/ace/WFMO_Reactor.cpp
index 34325fcb333..1317635b646 100644
--- a/ace/WFMO_Reactor.cpp
+++ b/ace/WFMO_Reactor.cpp
@@ -1622,15 +1622,33 @@ ACE_WFMO_Reactor::event_handling (ACE_Time_Value *max_wait_time,
// mut and event.
countdown.update ();
- // Calculate timeout
- int timeout = this->calculate_timeout (max_wait_time);
+ do
+ {
+ // Calculate timeout
+ int timeout = this->calculate_timeout (max_wait_time);
- // Wait for event to happen
- int wait_status = this->wait_for_multiple_events (timeout,
- alertable);
+ // Wait for event to happen
+ int wait_status = this->wait_for_multiple_events (timeout,
+ alertable);
- // Upcall
- result = this->safe_dispatch (wait_status);
+ // Upcall
+ result = this->safe_dispatch (wait_status);
+ if (0 == result)
+ {
+ // wait_for_multiple_events timed out without dispatching
+ // anything. Because of rounding and conversion errors and
+ // such, it could be that the wait loop timed out, but
+ // the timer queue said it wasn't quite ready to expire a
+ // timer. In this case, max_wait_time won't have quite been
+ // reduced to 0, and we need to go around again. If max_wait_time
+ // is all the way to 0, just return, as the entire time the
+ // caller wanted to wait has been used up.
+ countdown.update (); // Reflect time waiting for events
+ if (max_wait_time->usec () == 0)
+ break;
+ }
+ }
+ while (result == 0);
return result;
}
diff --git a/ace/config-sunos5.6.h b/ace/config-sunos5.6.h
index 572cb0bcf72..cc4388c5b93 100644
--- a/ace/config-sunos5.6.h
+++ b/ace/config-sunos5.6.h
@@ -112,6 +112,8 @@
#define ACE_HAS_AIO_CALLS
#endif /* ACE_HAS_AIO_CALLS */
+#define ACE_HAS_POSIX_SEM
+
// Sunos 5.6's aio_* with RT signals is broken.
#define ACE_POSIX_AIOCB_PROACTOR