[rtems commit] posix: Fix alarm() in SMP configurations

Sebastian Huber sebh at rtems.org
Wed Jan 11 12:52:46 UTC 2017


Module:    rtems
Branch:    master
Commit:    5aa0fa1cec4ca5b08a82a28c7f6dbdc416904989
Changeset: http://git.rtems.org/rtems/commit/?id=5aa0fa1cec4ca5b08a82a28c7f6dbdc416904989

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Jan 11 13:47:22 2017 +0100

posix: Fix alarm() in SMP configurations

Avoid to change the CPU of the watchdog right in the middle of the
critical section.  This would corrupt the watchdog lock states.

---

 cpukit/posix/src/alarm.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/cpukit/posix/src/alarm.c b/cpukit/posix/src/alarm.c
index 10443e4..dcc5643 100644
--- a/cpukit/posix/src/alarm.c
+++ b/cpukit/posix/src/alarm.c
@@ -83,8 +83,6 @@ unsigned int alarm(
   );
 
   if ( ticks != 0 ) {
-    cpu = _Per_CPU_Get();
-    _Watchdog_Set_CPU( the_watchdog, cpu );
     _Watchdog_Insert(
       &cpu->Watchdog.Header[ PER_CPU_WATCHDOG_RELATIVE ],
       the_watchdog,




More information about the vc mailing list