posix: Protect alarm()

Use thread dispatch disable/enable to ensure thread level mutual
exlusion.
This commit is contained in:
Sebastian Huber
2013-07-19 17:18:42 +02:00
parent e2005af632
commit a9cc1beb42

View File

@@ -57,6 +57,8 @@ unsigned int alarm(
the_timer = &_POSIX_signals_Alarm_timer;
_Thread_Disable_dispatch();
state = _Watchdog_Remove( the_timer );
if ( (state == WATCHDOG_ACTIVE) || (state == WATCHDOG_REMOVE_IT) ) {
/*
@@ -72,5 +74,7 @@ unsigned int alarm(
if ( seconds )
_Watchdog_Insert_seconds( the_timer, seconds );
_Thread_Enable_dispatch();
return remaining;
}