[rtems commit] score: Prevent thread_dispatch_disable_level < 0.

Sebastian Huber sebh at rtems.org
Tue Dec 13 07:01:47 UTC 2016


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

Author:    Christian Mauderer <Christian.Mauderer at embedded-brains.de>
Date:      Mon Dec 12 15:03:35 2016 +0100

score: Prevent thread_dispatch_disable_level < 0.

---

 cpukit/score/include/rtems/score/threaddispatch.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/cpukit/score/include/rtems/score/threaddispatch.h b/cpukit/score/include/rtems/score/threaddispatch.h
index 0238f8f..63eb4c6 100644
--- a/cpukit/score/include/rtems/score/threaddispatch.h
+++ b/cpukit/score/include/rtems/score/threaddispatch.h
@@ -232,6 +232,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Dispatch_enable( Per_CPU_Control *cpu_self )
 
     _ISR_Local_enable( level );
   } else {
+    _Assert( disable_level > 0 );
     cpu_self->thread_dispatch_disable_level = disable_level - 1;
   }
 }
@@ -243,6 +244,7 @@ RTEMS_INLINE_ROUTINE void _Thread_Dispatch_enable( Per_CPU_Control *cpu_self )
  */
 RTEMS_INLINE_ROUTINE void _Thread_Dispatch_unnest( Per_CPU_Control *cpu_self )
 {
+  _Assert( cpu_self->thread_dispatch_disable_level > 0 );
   --cpu_self->thread_dispatch_disable_level;
 }
 




More information about the vc mailing list