diff options
author | Jonathan Peyton <jonathan.l.peyton@intel.com> | 2016-01-27 21:20:26 +0000 |
---|---|---|
committer | Jonathan Peyton <jonathan.l.peyton@intel.com> | 2016-01-27 21:20:26 +0000 |
commit | 727ba6e84300a633bf1248b116d2eb3d6a8c79cc (patch) | |
tree | 5d708c8ba5b21a2968bcd834f614b78438774188 /openmp/runtime/src | |
parent | 4dd6778660d0f959688a64b535a12bc96b2b7dff (diff) | |
download | bcm5719-llvm-727ba6e84300a633bf1248b116d2eb3d6a8c79cc.tar.gz bcm5719-llvm-727ba6e84300a633bf1248b116d2eb3d6a8c79cc.zip |
Restore th_current_task first as suggested by John Mellor-Crummey
If an asynchronous inquiry peers into the runtime system
it doesn't see the freed task as the current task.
llvm-svn: 258990
Diffstat (limited to 'openmp/runtime/src')
-rw-r--r-- | openmp/runtime/src/kmp_tasking.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/openmp/runtime/src/kmp_tasking.c b/openmp/runtime/src/kmp_tasking.c index 8ea6554f859..fc9348c94e2 100644 --- a/openmp/runtime/src/kmp_tasking.c +++ b/openmp/runtime/src/kmp_tasking.c @@ -690,13 +690,12 @@ __kmp_task_finish( kmp_int32 gtid, kmp_task_t *task, kmp_taskdata_t *resumed_tas } // Free this task and then ancestor tasks if they have no children. + // Restore th_current_task first as suggested by John: + // johnmc: if an asynchronous inquiry peers into the runtime system + // it doesn't see the freed task as the current task. + thread->th.th_current_task = resumed_task; __kmp_free_task_and_ancestors(gtid, taskdata, thread); - // FIXME johnmc: I this statement should be before the last one so if an - // asynchronous inquiry peers into the runtime system it doesn't see the freed - // task as the current task - __kmp_threads[ gtid ] -> th.th_current_task = resumed_task; // restore current_task - // TODO: GEH - make sure root team implicit task is initialized properly. // KMP_DEBUG_ASSERT( resumed_task->td_flags.executing == 0 ); resumed_task->td_flags.executing = 1; // resume previous task |