pthread: Fix sem_timedwait() bug
authorBarret Rhoden <brho@cs.berkeley.edu>
Mon, 19 Oct 2015 15:36:54 +0000 (11:36 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Wed, 28 Oct 2015 16:05:12 +0000 (12:05 -0400)
__sem_timedblock() takes a sem_queue_element *, not a semaphore *.

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

index 3ecdf9a..1436bbe 100644 (file)
@@ -85,7 +85,7 @@ static void __sem_timedblock(struct uthread *uthread, void *arg)
        init_awaiter(&e->awaiter, __sem_timeout);
        set_awaiter_abs(&e->awaiter, e->us_timeout);
        set_alarm(&e->awaiter);
-       __sem_block(uthread, e->sem);
+       __sem_block(uthread, e);
 }
 
 int sem_wait (sem_t *__sem)