From a6a8e11e37186b451a5a539205554664f369eb86 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Fri, 23 May 2014 10:57:07 -0500 Subject: lookup_task.c: Lock around getting executing id. --- schedsim/shell/shared/lookup_task.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3