[rtems commit] rtems: Avoid Giant lock in rtems_task_mode()

Sebastian Huber sebh at rtems.org
Thu Mar 17 08:03:32 UTC 2016


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Mar 17 06:30:29 2016 +0100

rtems: Avoid Giant lock in rtems_task_mode()

Update #2555.

---

 cpukit/rtems/src/taskmode.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/cpukit/rtems/src/taskmode.c b/cpukit/rtems/src/taskmode.c
index fadca68..0fc0924 100644
--- a/cpukit/rtems/src/taskmode.c
+++ b/cpukit/rtems/src/taskmode.c
@@ -112,13 +112,14 @@ rtems_status_code rtems_task_mode(
   }
 
   if ( preempt_enabled || needs_asr_dispatching ) {
-    ISR_lock_Context lock_context;
+    Per_CPU_Control  *cpu_self;
+    ISR_lock_Context  lock_context;
 
-    _Thread_Disable_dispatch();
+    cpu_self = _Thread_Dispatch_disable();
     _Scheduler_Acquire( executing, &lock_context );
     _Scheduler_Schedule( executing );
     _Scheduler_Release( executing, &lock_context );
-    _Thread_Enable_dispatch();
+    _Thread_Dispatch_enable( cpu_self );
   }
 
   return RTEMS_SUCCESSFUL;



More information about the vc mailing list