summaryrefslogtreecommitdiff
path: root/examples/Timer_Queue
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1998-09-24 21:51:10 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1998-09-24 21:51:10 +0000
commitd13d91b0e6e9fc23ddbb58400c9667ee70416c08 (patch)
treed571faa2685ea5bdbd84ad5187e2710829f13c5d /examples/Timer_Queue
parent871a6a7f7d04b99f8df7ae002f25999aca65239f (diff)
downloadATCD-d13d91b0e6e9fc23ddbb58400c9667ee70416c08.tar.gz
.
Diffstat (limited to 'examples/Timer_Queue')
-rw-r--r--examples/Timer_Queue/Thread_Timer_Queue_Test.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/examples/Timer_Queue/Thread_Timer_Queue_Test.cpp b/examples/Timer_Queue/Thread_Timer_Queue_Test.cpp
index 62bb67921bb..4d3f2740218 100644
--- a/examples/Timer_Queue/Thread_Timer_Queue_Test.cpp
+++ b/examples/Timer_Queue/Thread_Timer_Queue_Test.cpp
@@ -134,7 +134,7 @@ Input_Task::add_timer (void *argument)
int
Input_Task::cancel_timer (void *argument)
{
- return this->queue_->cancel (*(int *) argument);
+ return this->queue_->cancel (*(int *) argument);
}
// Lists the timers in the queue. Ignores the argument. This method
@@ -162,12 +162,15 @@ Input_Task::shutdown_timer (void *argument)
// Macro to avoid "warning: unused parameter" type warning.
ACE_UNUSED_ARG (argument);
-#if !defined (ACE_LACKS_PTHREAD_CANCEL)
- // Cancel the thread timer queue task "preemptively."
- ACE_Thread::cancel (this->queue_->thr_id ());
-#else
+#if defined (ACE_LACKS_PTHREAD_CANCEL)
// Cancel the thread timer queue task "voluntarily."
this->queue_->deactivate ();
+#else
+ // Cancel the thread timer queue task "preemptively."
+ if (ACE_Thread::cancel (this->queue_->thr_id ()) == -1)
+ ACE_ERROR ((LM_ERROR,
+ "%p\n",
+ "cancel"));
#endif /* ACE_LACKS_PTHREAD_CANCEL */
// -1 indicates we are shutting down the application.