Fix timeout bug in semaphores
authorBarret Rhoden <brho@cs.berkeley.edu>
Thu, 11 Aug 2016 18:19:39 +0000 (14:19 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Fri, 12 Aug 2016 15:11:21 +0000 (11:11 -0400)
set_awaiter_abs() takes TSC ticks, not microseconds.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
user/pthread/semaphore.c

index 1436bbe..083e01a 100644 (file)
@@ -83,7 +83,7 @@ static void __sem_timedblock(struct uthread *uthread, void *arg)
        struct sem_queue_element *e = (struct sem_queue_element *)arg;
        e->awaiter.data = e;
        init_awaiter(&e->awaiter, __sem_timeout);
-       set_awaiter_abs(&e->awaiter, e->us_timeout);
+       set_awaiter_abs_unix(&e->awaiter, e->us_timeout);
        set_alarm(&e->awaiter);
        __sem_block(uthread, e);
 }