[rtems-schedsim commit] lookup_task.c: Lock around getting executing id.

Joel Sherrill joel at rtems.org
Fri May 23 18:14:43 UTC 2014


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

Author:    Joel Sherrill <joel.sherrill at oarcorp.com>
Date:      Fri May 23 10:57:07 2014 -0500

lookup_task.c: Lock around getting executing id.

---

 schedsim/shell/shared/lookup_task.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/schedsim/shell/shared/lookup_task.c b/schedsim/shell/shared/lookup_task.c
index e70eb4d..57740be 100644
--- a/schedsim/shell/shared/lookup_task.c
+++ b/schedsim/shell/shared/lookup_task.c
@@ -38,7 +38,9 @@ int METHOD_NAME(
   if ( string[0] != '0' ) {
     #ifdef DOING_TASKS
       if ( !strcmp( string, "SELF" ) ) {
-        *id = _Thread_Executing->Object.id;
+        _Thread_Disable_dispatch();
+          *id = _Thread_Executing->Object.id;
+        _Thread_Enable_dispatch();
         return 0;
       }
     #endif




More information about the vc mailing list