mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-17 06:38:28 +00:00
base: add mutex as derivate of lock
The mutex class is more restrictive in usage compared to Genode::Lock. - At initialiation time it is ever unlocked. - No thread is permitted to lock twice. Warn about it in case it happens. - Only the lock onwer is permitted to unlock the mutex. Warn about it and don't unlock the mutex in case it happens. Issue #3612
This commit is contained in:
committed by
Christian Helmuth
parent
d1609e771a
commit
00f69bc70d
@ -49,14 +49,13 @@ static inline bool thread_check_stopped_and_restart(Genode::Thread *thread_base)
|
||||
static inline void thread_switch_to(Genode::Thread *) { thread_yield(); }
|
||||
|
||||
|
||||
static inline void thread_stop_myself()
|
||||
static inline void thread_stop_myself(Genode::Thread *myself)
|
||||
{
|
||||
/*
|
||||
* Just go to sleep without modifying the counter value. The
|
||||
* 'thread_check_stopped_and_restart()' function will get called
|
||||
* repeatedly until this thread has actually executed the syscall.
|
||||
*/
|
||||
Genode::Thread *myself = Genode::Thread::myself();
|
||||
const int *futex_counter_ptr = myself ?
|
||||
&myself->native_thread().futex_counter :
|
||||
&main_thread_futex_counter;
|
||||
|
Reference in New Issue
Block a user