void bmk_sched_exit(void) __attribute__((__noreturn__));
void bmk_sched_block(struct bmk_thread *);
+#define BMK_SCHED_BLOCK_INFTIME -1
void bmk_sched_block_timeout(struct bmk_thread *, bmk_time_t);
void bmk_sched_wake(struct bmk_thread *);
next = NULL;
TAILQ_FOREACH_SAFE(thread, &threads, bt_entries, tmp) {
if (!is_runnable(thread)
- && thread->bt_wakeup_time >= 0) {
+ && thread->bt_wakeup_time
+ != BMK_SCHED_BLOCK_INFTIME) {
if (thread->bt_wakeup_time <= tm) {
thread->bt_flags |= THREAD_TIMEDOUT;
bmk_sched_wake(thread);
thread->bt_cookie = cookie;
- thread->bt_wakeup_time = -1;
+ thread->bt_wakeup_time = BMK_SCHED_BLOCK_INFTIME;
allocothertls(thread);
bmk_sched_block(struct bmk_thread *thread)
{
- bmk_sched_block_timeout(thread, -1);
+ bmk_sched_block_timeout(thread, BMK_SCHED_BLOCK_INFTIME);
}
int
bmk_sched_wake(struct bmk_thread *thread)
{
- thread->bt_wakeup_time = -1;
+ thread->bt_wakeup_time = BMK_SCHED_BLOCK_INFTIME;
set_runnable(thread);
}