diff options
| -rw-r--r-- | openmp/runtime/src/kmp_lock.cpp | 2 | ||||
| -rw-r--r-- | openmp/runtime/src/kmp_os.h | 4 | ||||
| -rw-r--r-- | openmp/runtime/src/kmp_tasking.c | 4 |
3 files changed, 7 insertions, 3 deletions
diff --git a/openmp/runtime/src/kmp_lock.cpp b/openmp/runtime/src/kmp_lock.cpp index 53f4d9847c2..6f15e0dcfaa 100644 --- a/openmp/runtime/src/kmp_lock.cpp +++ b/openmp/runtime/src/kmp_lock.cpp @@ -2507,7 +2507,7 @@ __kmp_acquire_drdpa_lock_timed_template( kmp_drdpa_lock_t *lck, kmp_int32 gtid ) KMP_FSYNC_PREPARE(lck); KMP_INIT_YIELD(spins); - while (TCR_8(polls[ticket & mask]).poll < ticket) { // volatile load + while (TCR_8(polls[ticket & mask].poll) < ticket) { // volatile load // If we are oversubscribed, // or have waited a bit (and KMP_LIBRARY=turnaround), then yield. // CPU Pause is in the macros for yield. diff --git a/openmp/runtime/src/kmp_os.h b/openmp/runtime/src/kmp_os.h index 017eae4c52a..c0441d69a2d 100644 --- a/openmp/runtime/src/kmp_os.h +++ b/openmp/runtime/src/kmp_os.h @@ -596,8 +596,12 @@ extern kmp_real64 __kmp_xchg_real64( volatile kmp_real64 *p, kmp_real64 v ); #define TCR_4(a) (a) #define TCW_4(a,b) (a) = (b) +#define TCI_4(a) (++(a)) +#define TCD_4(a) (--(a)) #define TCR_8(a) (a) #define TCW_8(a,b) (a) = (b) +#define TCI_8(a) (++(a)) +#define TCD_8(a) (--(a)) #define TCR_SYNC_4(a) (a) #define TCW_SYNC_4(a,b) (a) = (b) #define TCX_SYNC_4(a,b,c) KMP_COMPARE_AND_STORE_REL32((volatile kmp_int32 *)(volatile void *)&(a), (kmp_int32)(b), (kmp_int32)(c)) diff --git a/openmp/runtime/src/kmp_tasking.c b/openmp/runtime/src/kmp_tasking.c index 1b89f0213d8..1081c150c41 100644 --- a/openmp/runtime/src/kmp_tasking.c +++ b/openmp/runtime/src/kmp_tasking.c @@ -2845,7 +2845,7 @@ static void __kmp_first_top_half_finish_proxy( kmp_taskdata_t * taskdata ) KMP_TEST_THEN_DEC32( (kmp_int32 *)(& taskdata->td_taskgroup->count) ); // Create an imaginary children for this task so the bottom half cannot release the task before we have completed the second top half - TCR_4(taskdata->td_incomplete_child_tasks++); + TCI_4(taskdata->td_incomplete_child_tasks); } static void __kmp_second_top_half_finish_proxy( kmp_taskdata_t * taskdata ) @@ -2857,7 +2857,7 @@ static void __kmp_second_top_half_finish_proxy( kmp_taskdata_t * taskdata ) KMP_DEBUG_ASSERT( children >= 0 ); // Remove the imaginary children - TCR_4(taskdata->td_incomplete_child_tasks--); + TCD_4(taskdata->td_incomplete_child_tasks); } static void __kmp_bottom_half_finish_proxy( kmp_int32 gtid, kmp_task_t * ptask ) |

