Rework previous slightly, to only signal if we were using WAITUNTIL() and we
actually have a due time
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user