From 86921c2e12832f5bbb3cfe114fe83a879c57f19e Mon Sep 17 00:00:00 2001 From: Alexander Boettcher Date: Wed, 27 Jun 2012 14:39:36 +0200 Subject: [PATCH] Use down-to-zero semaphore feature to block thread Use semaphore down feature of NOVA to set the counter to zero. If the semaphore was up()ed more than one time by impatient callers (e.g. guys calling cancel_blocking) we make sure that the thread really stops. --- base-nova/src/base/lock/lock_helper.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base-nova/src/base/lock/lock_helper.h b/base-nova/src/base/lock/lock_helper.h index d31adcf53..0e0386aa4 100644 --- a/base-nova/src/base/lock/lock_helper.h +++ b/base-nova/src/base/lock/lock_helper.h @@ -84,5 +84,5 @@ static inline void thread_stop_myself() { Genode::Thread_base *myself = Genode::Thread_base::myself(); int sem = myself ? myself->tid().rs_sel : main_thread_running_semaphore(); - Nova::sm_ctrl(sem, Nova::SEMAPHORE_DOWN); + Nova::sm_ctrl(sem, Nova::SEMAPHORE_DOWNZERO); }