summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1997-09-17 00:41:34 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1997-09-17 00:41:34 +0000
commit22b8b48598a9080dfcbecfa2864ed70e5d8e8f03 (patch)
tree0c515440f9e4feb9f5b3bf44fbf8f8fc895488d8
parentcee327a2480335ab4435d6552d475082957b4280 (diff)
downloadATCD-22b8b48598a9080dfcbecfa2864ed70e5d8e8f03.tar.gz
*** empty log message ***
-rw-r--r--ChangeLog-97b15
-rw-r--r--ace/Timer_Queue_T.cpp12
-rw-r--r--ace/Timer_Queue_T.h4
-rw-r--r--tests/Async_Timer_Queue_Test.cpp9
4 files changed, 30 insertions, 10 deletions
diff --git a/ChangeLog-97b b/ChangeLog-97b
index b4ed9100853..9d2c2696f3a 100644
--- a/ChangeLog-97b
+++ b/ChangeLog-97b
@@ -1,15 +1,18 @@
-Tue Sep 16 18:03:58 1997 Carlos O'Ryan <coryan@macarena.cs.wustl.edu>
-
- * bin/auto_compile:
- It wouldn't report an error when run_tests.sh scream "FAILED",
- now it does.
-
Tue Sep 16 11:42:32 1997 Douglas C. Schmidt <schmidt@flamenco.cs.wustl.edu>
+ * ace/Timer_Queue_T: Added an expire() wrapper for the
+ Async_Timer_Queue_Adapter.
+
* ace/OS: Added a wrapper for strpbrk() and wcspbrk(). Thanks to
Bob Olson <olson@jeeves.mcs.anl.gov> and Irfan for pointing out
the need for this.
+Tue Sep 16 18:03:58 1997 Carlos O'Ryan <coryan@macarena.cs.wustl.edu>
+
+ * bin/auto_compile:
+ It wouldn't report an error when run_tests.sh scream "FAILED",
+ now it does.
+
Tue Sep 16 08:30:28 1997 Steve Huston <shuston@riverace.com>
* ace/OS.i: Changed a couple of ACE_UNUSED(arg) to ACE_UNUSED_ARG(arg)
diff --git a/ace/Timer_Queue_T.cpp b/ace/Timer_Queue_T.cpp
index 1c5e3babf02..5ba383def39 100644
--- a/ace/Timer_Queue_T.cpp
+++ b/ace/Timer_Queue_T.cpp
@@ -297,6 +297,16 @@ ACE_Async_Timer_Queue_Adapter<TQ>::cancel (long timer_id,
return this->timer_queue_.cancel (timer_id, act);
}
+template <class TQ> int
+ACE_Async_Timer_Queue_Adapter<TQ>::expire (void)
+{
+ // Block designated signals.
+ ACE_Sig_Guard sg (&this->mask_);
+ ACE_UNUSED_ARG (sg);
+
+ return this->timer_queue_.expire ();
+}
+
template <class TQ> long
ACE_Async_Timer_Queue_Adapter<TQ>::schedule (ACE_Event_Handler *eh,
const void *act,
@@ -340,7 +350,7 @@ ACE_Async_Timer_Queue_Adapter<TQ>::ACE_Async_Timer_Queue_Adapter (ACE_Sig_Set *m
// running, else just block those in the mask.
: mask_ (mask)
{
- // The following code is necessary to selectively "block" all
+ // The following code is necessary to selectively "block" certain
// signals when SIGALRM is running. Also, we always restart system
// calls that are interrupted by the signals.
diff --git a/ace/Timer_Queue_T.h b/ace/Timer_Queue_T.h
index db74cdfc4d5..e979d1a4c58 100644
--- a/ace/Timer_Queue_T.h
+++ b/ace/Timer_Queue_T.h
@@ -379,6 +379,10 @@ public:
// Cancel the <timer_id> and pass back the <act> if an address is
// passed in.
+ int expire (void);
+ // Dispatch all timers whose values are <= <cur_time>. Returns the
+ // number of timers canceled.
+
TQ &timer_queue (void);
// Access the underlying <TIMER_QUEUE>.
diff --git a/tests/Async_Timer_Queue_Test.cpp b/tests/Async_Timer_Queue_Test.cpp
index c166c016a23..16467600ac7 100644
--- a/tests/Async_Timer_Queue_Test.cpp
+++ b/tests/Async_Timer_Queue_Test.cpp
@@ -168,6 +168,8 @@ parse_commands (const char *buf)
u_int choice;
long value;
+ // @@ Should make sure to use signal-safe logic here...
+
if (sscanf (buf, "%u %ld", &choice, &value) != 2)
ACE_ERROR_RETURN ((LM_ERROR, "invalid input %s", buf), -1);
@@ -238,9 +240,10 @@ register_signal_handlers (void)
static char menu[] =
"****\n"
-"1) schedule_timer <usecs> \n"
-"2) cancel_timer <timer_id>\n"
-"^C list_timers\n"
+"1) schedule timer <usecs> \n"
+"2) cancel timer <timer_id>\n"
+"^C list timers\n"
+"^\ exit program\n"
"please enter your choice: ";
int