* 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>
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.
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.
*/
/*
* Schedule the timer.
*/
- manager = timer->manager;
+
if (timer->index > 0) {
/*
* Already scheduled.
* 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;