parent
3e8e55ec16
commit
3cb6dba572
|
@ -340,7 +340,7 @@ extern "C" {
|
||||||
*/
|
*/
|
||||||
sys_prot_t sys_arch_protect(void)
|
sys_prot_t sys_arch_protect(void)
|
||||||
{
|
{
|
||||||
if(global_mutex()->thread == Genode::Thread_base::myself())
|
if (global_mutex()->thread == Genode::Thread_base::myself())
|
||||||
return ++global_mutex()->counter;
|
return ++global_mutex()->counter;
|
||||||
global_mutex()->lock.lock();
|
global_mutex()->lock.lock();
|
||||||
global_mutex()->thread = Genode::Thread_base::myself();
|
global_mutex()->thread = Genode::Thread_base::myself();
|
||||||
|
@ -353,13 +353,13 @@ extern "C" {
|
||||||
*/
|
*/
|
||||||
void sys_arch_unprotect(sys_prot_t pval)
|
void sys_arch_unprotect(sys_prot_t pval)
|
||||||
{
|
{
|
||||||
if(global_mutex()->thread != Genode::Thread_base::myself())
|
if (global_mutex()->thread != Genode::Thread_base::myself())
|
||||||
return;
|
return;
|
||||||
if(global_mutex()->counter > 1)
|
if (global_mutex()->counter > 1)
|
||||||
global_mutex()->counter--;
|
global_mutex()->counter--;
|
||||||
else {
|
else {
|
||||||
global_mutex()->counter = 0;
|
global_mutex()->counter = 0;
|
||||||
global_mutex()->thread = 0;
|
global_mutex()->thread = (Genode::Thread_base*)-1;
|
||||||
global_mutex()->lock.unlock();
|
global_mutex()->lock.unlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue