Leads the threads to end immediately, avoiding a lengthy timeout.
task = NULL;
} else if (vv == VV_FAIL) {
task_stop();
+ task_wakeup();
}
break;
}
enabled = true;
}
+static void
+__wakeup(void)
+{
+ panic_on_fail(pthread_cond_broadcast(&awakener),
+ "pthread_cond_broadcast");
+}
+
/* Returns true if the module had already been stopped. */
bool
task_stop(void)
mutex_lock(&lock);
result = !enabled;
cleanup();
+ __wakeup();
mutex_unlock(&lock);
return result;
task_wakeup(void)
{
mutex_lock(&lock);
- panic_on_fail(pthread_cond_broadcast(&awakener),
- "pthread_cond_broadcast");
+ __wakeup();
mutex_unlock(&lock);
}
{
mutex_lock(&lock);
STAILQ_CONCAT(&waiting, &dormant);
- panic_on_fail(pthread_cond_broadcast(&awakener),
- "pthread_cond_broadcast");
+ __wakeup();
mutex_unlock(&lock);
}