diff options
Diffstat (limited to 'openmp/runtime/src/kmp_tasking.c')
-rw-r--r-- | openmp/runtime/src/kmp_tasking.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/openmp/runtime/src/kmp_tasking.c b/openmp/runtime/src/kmp_tasking.c index e6f72a1000a..8c5794585e8 100644 --- a/openmp/runtime/src/kmp_tasking.c +++ b/openmp/runtime/src/kmp_tasking.c @@ -1274,9 +1274,10 @@ __kmp_omp_task( kmp_int32 gtid, kmp_task_t * new_task, bool serialize_immediate kmp_int32 __kmpc_omp_task( ident_t *loc_ref, kmp_int32 gtid, kmp_task_t * new_task) { - kmp_taskdata_t * new_taskdata = KMP_TASK_TO_TASKDATA(new_task); + kmp_taskdata_t * new_taskdata; kmp_int32 res; + new_taskdata = KMP_TASK_TO_TASKDATA(new_task); KA_TRACE(10, ("__kmpc_omp_task(enter): T#%d loc=%p task=%p\n", gtid, loc_ref, new_taskdata ) ); @@ -1636,7 +1637,9 @@ __kmp_steal_task( kmp_info_t *victim, kmp_int32 gtid, kmp_task_team_t *task_team // We need to un-mark this victim as a finished victim. This must be done before // releasing the lock, or else other threads (starting with the master victim) // might be prematurely released from the barrier!!! - kmp_uint32 count = KMP_TEST_THEN_INC32( (kmp_int32 *)unfinished_threads ); + kmp_uint32 count; + + count = KMP_TEST_THEN_INC32( (kmp_int32 *)unfinished_threads ); KA_TRACE(20, ("__kmp_steal_task: T#%d inc unfinished_threads to %d: task_team=%p\n", gtid, count + 1, task_team) ); @@ -1744,7 +1747,9 @@ static inline int __kmp_execute_tasks_template(kmp_info_t *thread, kmp_int32 gti // been done. This decrement might be to the spin location, and // result in the termination condition being satisfied. if (! *thread_finished) { - kmp_uint32 count = KMP_TEST_THEN_DEC32( (kmp_int32 *)unfinished_threads ) - 1; + kmp_uint32 count; + + count = KMP_TEST_THEN_DEC32( (kmp_int32 *)unfinished_threads ) - 1; KA_TRACE(20, ("__kmp_execute_tasks_template(dec #1): T#%d dec unfinished_threads to %d task_team=%p\n", gtid, count, task_team) ); *thread_finished = TRUE; @@ -1825,7 +1830,9 @@ static inline int __kmp_execute_tasks_template(kmp_info_t *thread, kmp_int32 gti // been done. This decrement might be to the spin location, and // result in the termination condition being satisfied. if (! *thread_finished) { - kmp_uint32 count = KMP_TEST_THEN_DEC32( (kmp_int32 *)unfinished_threads ) - 1; + kmp_uint32 count; + + count = KMP_TEST_THEN_DEC32( (kmp_int32 *)unfinished_threads ) - 1; KA_TRACE(20, ("__kmp_execute_tasks_template(dec #2): T#%d dec unfinished_threads to %d " "task_team=%p\n", gtid, count, task_team) ); *thread_finished = TRUE; @@ -1938,7 +1945,9 @@ static inline int __kmp_execute_tasks_template(kmp_info_t *thread, kmp_int32 gti // been done. This decrement might be to the spin location, and // result in the termination condition being satisfied. if (! *thread_finished) { - kmp_uint32 count = KMP_TEST_THEN_DEC32( (kmp_int32 *)unfinished_threads ) - 1; + kmp_uint32 count; + + count = KMP_TEST_THEN_DEC32( (kmp_int32 *)unfinished_threads ) - 1; KA_TRACE(20, ("__kmp_execute_tasks_template(dec #3): T#%d dec unfinished_threads to %d; " "task_team=%p\n", gtid, count, task_team) ); @@ -1996,13 +2005,14 @@ int __kmp_execute_tasks_oncore(kmp_info_t *thread, kmp_int32 gtid, kmp_flag_onco static void __kmp_enable_tasking( kmp_task_team_t *task_team, kmp_info_t *this_thr ) { - kmp_team_t *team = this_thr->th.th_team; + kmp_team_t *team; kmp_thread_data_t *threads_data; int nthreads, i, is_init_thread; KA_TRACE( 10, ( "__kmp_enable_tasking(enter): T#%d\n", __kmp_gtid_from_thread( this_thr ) ) ); + team = this_thr->th.th_team; KMP_DEBUG_ASSERT(task_team != NULL); KMP_DEBUG_ASSERT(team != NULL); |