summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2017-11-16 07:17:05 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-11-16 07:45:17 +0100
commit888da71502d43b562829d2387b2a5dfce7bb35e4 (patch)
tree27dc78f6450b277ea12608f700df524b65c18f22
parentlibio: Add assert to rtems_libio_iop_drop() (diff)
downloadrtems-888da71502d43b562829d2387b2a5dfce7bb35e4.tar.bz2
score: Check thread resource count in timer server
The watchdog routines invoked by the timer server may use mutexes for synchronization. Ensure that the resource count of the timer server is zero after each watchdog routine invocation. This helps to detect broken watchdog routines.
-rw-r--r--cpukit/rtems/src/timerserver.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/cpukit/rtems/src/timerserver.c b/cpukit/rtems/src/timerserver.c
index dfdba8c2e2..894d50efc0 100644
--- a/cpukit/rtems/src/timerserver.c
+++ b/cpukit/rtems/src/timerserver.c
@@ -15,7 +15,7 @@
/* COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR).
*
- * Copyright (c) 2009, 2016 embedded brains GmbH.
+ * Copyright (c) 2009, 2017 embedded brains GmbH.
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
@@ -92,6 +92,9 @@ static rtems_task _Timer_server_Body(
)
{
Timer_server_Control *ts = (Timer_server_Control *) arg;
+#if defined(RTEMS_SCORE_THREAD_ENABLE_RESOURCE_COUNT)
+ Thread_Control *executing = _Thread_Get_executing();
+#endif
while ( true ) {
ISR_lock_Context lock_context;
@@ -121,6 +124,9 @@ static rtems_task _Timer_server_Body(
_Timer_server_Release( ts, &lock_context );
( *routine )( id, user_data );
+#if defined(RTEMS_SCORE_THREAD_ENABLE_RESOURCE_COUNT)
+ _Assert( !_Thread_Owns_resources( executing ) );
+#endif
_Timer_server_Acquire( ts, &lock_context );
}