mirror of
https://github.com/genodelabs/genode.git
synced 2025-03-21 19:45:52 +00:00
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:
parent
cd886bff6a
commit
86921c2e12
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user