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.
This commit is contained in:
Alexander Boettcher 2012-06-27 14:39:36 +02:00 committed by Norman Feske
parent cd886bff6a
commit 86921c2e12
1 changed files with 1 additions and 1 deletions

View File

@ -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);
}