[rtems commit] bsps: Avoid Giant lock in simulator clock driver

Sebastian Huber sebh at rtems.org
Fri Mar 4 14:16:24 UTC 2016


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Mar  4 15:13:45 2016 +0100

bsps: Avoid Giant lock in simulator clock driver

Update #2555.

---

 c/src/lib/libbsp/shared/clock_driver_simidle.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/c/src/lib/libbsp/shared/clock_driver_simidle.c b/c/src/lib/libbsp/shared/clock_driver_simidle.c
index e850311..5826bb5 100644
--- a/c/src/lib/libbsp/shared/clock_driver_simidle.c
+++ b/c/src/lib/libbsp/shared/clock_driver_simidle.c
@@ -50,11 +50,11 @@ void *clock_driver_sim_idle_body(
 {
   for( ; ; ) {
     if ( clock_driver_enabled ) {
-      _Thread_Disable_dispatch();
+      Per_CPU_Control *cpu = _Thread_Dispatch_disable();
       _ISR_Nest_level++;
-	rtems_clock_tick();
+      rtems_clock_tick();
       _ISR_Nest_level--;
-      _Thread_Enable_dispatch();
+      _Thread_Dispatch_enable( cpu );
       BSP_CLOCK_DRIVER_DELAY();
     }
   }



More information about the vc mailing list