Commit de6aca41 authored by Michael Graff's avatar Michael Graff
Browse files

Rework previous slightly, to only signal if we were using WAITUNTIL() and we

actually have a due time
parent 14b6c928
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: timer.c,v 1.70 2002/09/09 20:04:10 explorer Exp $ */
/* $Id: timer.c,v 1.71 2002/09/09 21:15:58 explorer Exp $ */
#include <config.h>
......@@ -111,6 +111,9 @@ schedule(isc_timer_t *timer, isc_time_t *now, isc_boolean_t signal_ok) {
isc_timermgr_t *manager;
isc_time_t due;
int cmp;
#ifdef ISC_PLATFORM_USETHREADS
isc_boolean_t timedwait;
#endif
/*
* Note: the caller must ensure locking.
......@@ -122,6 +125,16 @@ schedule(isc_timer_t *timer, isc_time_t *now, isc_boolean_t signal_ok) {
UNUSED(signal_ok);
#endif /* ISC_PLATFORM_USETHREADS */
manager = timer->manager;
#ifdef ISC_PLATFORM_USETHREADS
/*
* If the manager was timed wait, we may need to signal the
* manager to force a wakeup.
*/
timedwait = ISC_TF(manager->nscheduled > 0 && manager->due.seconds != 0);
#endif
/*
* Compute the new due time.
*/
......@@ -146,7 +159,7 @@ schedule(isc_timer_t *timer, isc_time_t *now, isc_boolean_t signal_ok) {
/*
* Schedule the timer.
*/
manager = timer->manager;
if (timer->index > 0) {
/*
* Already scheduled.
......@@ -193,7 +206,7 @@ schedule(isc_timer_t *timer, isc_time_t *now, isc_boolean_t signal_ok) {
* the dispatcher. This isn't such a bad idea as a general purpose
* watchdog, so perhaps we should just leave it in here.
*/
if (signal_ok) {
if (signal_ok && timedwait) {
isc_interval_t fifteen;
isc_time_t then;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment