• Home
  • Raw
  • Download

Lines Matching refs:gtid

81 __kmp_acquire_tas_lock_timed_template(kmp_tas_lock_t *lck, kmp_int32 gtid) {  in __kmp_acquire_tas_lock_timed_template()  argument
86 if ((curr != 0) && (curr != gtid + 1)) in __kmp_acquire_tas_lock_timed_template()
92 kmp_int32 tas_busy = KMP_LOCK_BUSY(gtid + 1, tas); in __kmp_acquire_tas_lock_timed_template()
113 int __kmp_acquire_tas_lock(kmp_tas_lock_t *lck, kmp_int32 gtid) { in __kmp_acquire_tas_lock() argument
114 int retval = __kmp_acquire_tas_lock_timed_template(lck, gtid); in __kmp_acquire_tas_lock()
120 kmp_int32 gtid) { in __kmp_acquire_tas_lock_with_checks() argument
126 if ((gtid >= 0) && (__kmp_get_tas_lock_owner(lck) == gtid)) { in __kmp_acquire_tas_lock_with_checks()
129 return __kmp_acquire_tas_lock(lck, gtid); in __kmp_acquire_tas_lock_with_checks()
132 int __kmp_test_tas_lock(kmp_tas_lock_t *lck, kmp_int32 gtid) { in __kmp_test_tas_lock() argument
134 kmp_int32 tas_busy = KMP_LOCK_BUSY(gtid + 1, tas); in __kmp_test_tas_lock()
144 kmp_int32 gtid) { in __kmp_test_tas_lock_with_checks() argument
150 return __kmp_test_tas_lock(lck, gtid); in __kmp_test_tas_lock_with_checks()
153 int __kmp_release_tas_lock(kmp_tas_lock_t *lck, kmp_int32 gtid) { in __kmp_release_tas_lock() argument
166 kmp_int32 gtid) { in __kmp_release_tas_lock_with_checks() argument
176 if ((gtid >= 0) && (__kmp_get_tas_lock_owner(lck) >= 0) && in __kmp_release_tas_lock_with_checks()
177 (__kmp_get_tas_lock_owner(lck) != gtid)) { in __kmp_release_tas_lock_with_checks()
180 return __kmp_release_tas_lock(lck, gtid); in __kmp_release_tas_lock_with_checks()
203 int __kmp_acquire_nested_tas_lock(kmp_tas_lock_t *lck, kmp_int32 gtid) { in __kmp_acquire_nested_tas_lock() argument
204 KMP_DEBUG_ASSERT(gtid >= 0); in __kmp_acquire_nested_tas_lock()
206 if (__kmp_get_tas_lock_owner(lck) == gtid) { in __kmp_acquire_nested_tas_lock()
210 __kmp_acquire_tas_lock_timed_template(lck, gtid); in __kmp_acquire_nested_tas_lock()
218 kmp_int32 gtid) { in __kmp_acquire_nested_tas_lock_with_checks() argument
223 return __kmp_acquire_nested_tas_lock(lck, gtid); in __kmp_acquire_nested_tas_lock_with_checks()
226 int __kmp_test_nested_tas_lock(kmp_tas_lock_t *lck, kmp_int32 gtid) { in __kmp_test_nested_tas_lock() argument
229 KMP_DEBUG_ASSERT(gtid >= 0); in __kmp_test_nested_tas_lock()
231 if (__kmp_get_tas_lock_owner(lck) == gtid) { in __kmp_test_nested_tas_lock()
233 } else if (!__kmp_test_tas_lock(lck, gtid)) { in __kmp_test_nested_tas_lock()
243 kmp_int32 gtid) { in __kmp_test_nested_tas_lock_with_checks() argument
248 return __kmp_test_nested_tas_lock(lck, gtid); in __kmp_test_nested_tas_lock_with_checks()
251 int __kmp_release_nested_tas_lock(kmp_tas_lock_t *lck, kmp_int32 gtid) { in __kmp_release_nested_tas_lock() argument
252 KMP_DEBUG_ASSERT(gtid >= 0); in __kmp_release_nested_tas_lock()
256 __kmp_release_tas_lock(lck, gtid); in __kmp_release_nested_tas_lock()
263 kmp_int32 gtid) { in __kmp_release_nested_tas_lock_with_checks() argument
272 if (__kmp_get_tas_lock_owner(lck) != gtid) { in __kmp_release_nested_tas_lock_with_checks()
275 return __kmp_release_nested_tas_lock(lck, gtid); in __kmp_release_nested_tas_lock_with_checks()
318 __kmp_acquire_futex_lock_timed_template(kmp_futex_lock_t *lck, kmp_int32 gtid) { in __kmp_acquire_futex_lock_timed_template() argument
319 kmp_int32 gtid_code = (gtid + 1) << 1; in __kmp_acquire_futex_lock_timed_template()
332 lck, lck->lk.poll, gtid)); in __kmp_acquire_futex_lock_timed_template()
344 lck, gtid, poll_val, cond)); in __kmp_acquire_futex_lock_timed_template()
360 lck, lck->lk.poll, gtid)); in __kmp_acquire_futex_lock_timed_template()
367 lck->lk.poll, gtid)); in __kmp_acquire_futex_lock_timed_template()
373 lck, gtid, poll_val)); in __kmp_acquire_futex_lock_timed_template()
380 lck, gtid, poll_val, rc, errno)); in __kmp_acquire_futex_lock_timed_template()
386 lck, gtid, poll_val)); in __kmp_acquire_futex_lock_timed_template()
395 lck->lk.poll, gtid)); in __kmp_acquire_futex_lock_timed_template()
399 int __kmp_acquire_futex_lock(kmp_futex_lock_t *lck, kmp_int32 gtid) { in __kmp_acquire_futex_lock() argument
400 int retval = __kmp_acquire_futex_lock_timed_template(lck, gtid); in __kmp_acquire_futex_lock()
406 kmp_int32 gtid) { in __kmp_acquire_futex_lock_with_checks() argument
412 if ((gtid >= 0) && (__kmp_get_futex_lock_owner(lck) == gtid)) { in __kmp_acquire_futex_lock_with_checks()
415 return __kmp_acquire_futex_lock(lck, gtid); in __kmp_acquire_futex_lock_with_checks()
418 int __kmp_test_futex_lock(kmp_futex_lock_t *lck, kmp_int32 gtid) { in __kmp_test_futex_lock() argument
420 KMP_LOCK_BUSY((gtid + 1) << 1, futex))) { in __kmp_test_futex_lock()
428 kmp_int32 gtid) { in __kmp_test_futex_lock_with_checks() argument
434 return __kmp_test_futex_lock(lck, gtid); in __kmp_test_futex_lock_with_checks()
437 int __kmp_release_futex_lock(kmp_futex_lock_t *lck, kmp_int32 gtid) { in __kmp_release_futex_lock() argument
441 lck, lck->lk.poll, gtid)); in __kmp_release_futex_lock()
450 lck, gtid, poll_val)); in __kmp_release_futex_lock()
455 lck, gtid)); in __kmp_release_futex_lock()
463 lck->lk.poll, gtid)); in __kmp_release_futex_lock()
470 kmp_int32 gtid) { in __kmp_release_futex_lock_with_checks() argument
480 if ((gtid >= 0) && (__kmp_get_futex_lock_owner(lck) >= 0) && in __kmp_release_futex_lock_with_checks()
481 (__kmp_get_futex_lock_owner(lck) != gtid)) { in __kmp_release_futex_lock_with_checks()
484 return __kmp_release_futex_lock(lck, gtid); in __kmp_release_futex_lock_with_checks()
507 int __kmp_acquire_nested_futex_lock(kmp_futex_lock_t *lck, kmp_int32 gtid) { in __kmp_acquire_nested_futex_lock() argument
508 KMP_DEBUG_ASSERT(gtid >= 0); in __kmp_acquire_nested_futex_lock()
510 if (__kmp_get_futex_lock_owner(lck) == gtid) { in __kmp_acquire_nested_futex_lock()
514 __kmp_acquire_futex_lock_timed_template(lck, gtid); in __kmp_acquire_nested_futex_lock()
522 kmp_int32 gtid) { in __kmp_acquire_nested_futex_lock_with_checks() argument
527 return __kmp_acquire_nested_futex_lock(lck, gtid); in __kmp_acquire_nested_futex_lock_with_checks()
530 int __kmp_test_nested_futex_lock(kmp_futex_lock_t *lck, kmp_int32 gtid) { in __kmp_test_nested_futex_lock() argument
533 KMP_DEBUG_ASSERT(gtid >= 0); in __kmp_test_nested_futex_lock()
535 if (__kmp_get_futex_lock_owner(lck) == gtid) { in __kmp_test_nested_futex_lock()
537 } else if (!__kmp_test_futex_lock(lck, gtid)) { in __kmp_test_nested_futex_lock()
547 kmp_int32 gtid) { in __kmp_test_nested_futex_lock_with_checks() argument
552 return __kmp_test_nested_futex_lock(lck, gtid); in __kmp_test_nested_futex_lock_with_checks()
555 int __kmp_release_nested_futex_lock(kmp_futex_lock_t *lck, kmp_int32 gtid) { in __kmp_release_nested_futex_lock() argument
556 KMP_DEBUG_ASSERT(gtid >= 0); in __kmp_release_nested_futex_lock()
560 __kmp_release_futex_lock(lck, gtid); in __kmp_release_nested_futex_lock()
567 kmp_int32 gtid) { in __kmp_release_nested_futex_lock_with_checks() argument
576 if (__kmp_get_futex_lock_owner(lck) != gtid) { in __kmp_release_nested_futex_lock_with_checks()
579 return __kmp_release_nested_futex_lock(lck, gtid); in __kmp_release_nested_futex_lock_with_checks()
626 kmp_int32 gtid) { in __kmp_acquire_ticket_lock_timed_template() argument
645 int __kmp_acquire_ticket_lock(kmp_ticket_lock_t *lck, kmp_int32 gtid) { in __kmp_acquire_ticket_lock() argument
646 int retval = __kmp_acquire_ticket_lock_timed_template(lck, gtid); in __kmp_acquire_ticket_lock()
652 kmp_int32 gtid) { in __kmp_acquire_ticket_lock_with_checks() argument
665 if ((gtid >= 0) && (__kmp_get_ticket_lock_owner(lck) == gtid)) { in __kmp_acquire_ticket_lock_with_checks()
669 __kmp_acquire_ticket_lock(lck, gtid); in __kmp_acquire_ticket_lock_with_checks()
671 std::atomic_store_explicit(&lck->lk.owner_id, gtid + 1, in __kmp_acquire_ticket_lock_with_checks()
676 int __kmp_test_ticket_lock(kmp_ticket_lock_t *lck, kmp_int32 gtid) { in __kmp_test_ticket_lock() argument
693 kmp_int32 gtid) { in __kmp_test_ticket_lock_with_checks() argument
707 int retval = __kmp_test_ticket_lock(lck, gtid); in __kmp_test_ticket_lock_with_checks()
710 std::atomic_store_explicit(&lck->lk.owner_id, gtid + 1, in __kmp_test_ticket_lock_with_checks()
716 int __kmp_release_ticket_lock(kmp_ticket_lock_t *lck, kmp_int32 gtid) { in __kmp_release_ticket_lock() argument
732 kmp_int32 gtid) { in __kmp_release_ticket_lock_with_checks() argument
748 if ((gtid >= 0) && (__kmp_get_ticket_lock_owner(lck) >= 0) && in __kmp_release_ticket_lock_with_checks()
749 (__kmp_get_ticket_lock_owner(lck) != gtid)) { in __kmp_release_ticket_lock_with_checks()
753 return __kmp_release_ticket_lock(lck, gtid); in __kmp_release_ticket_lock_with_checks()
808 int __kmp_acquire_nested_ticket_lock(kmp_ticket_lock_t *lck, kmp_int32 gtid) { in __kmp_acquire_nested_ticket_lock() argument
809 KMP_DEBUG_ASSERT(gtid >= 0); in __kmp_acquire_nested_ticket_lock()
811 if (__kmp_get_ticket_lock_owner(lck) == gtid) { in __kmp_acquire_nested_ticket_lock()
816 __kmp_acquire_ticket_lock_timed_template(lck, gtid); in __kmp_acquire_nested_ticket_lock()
820 std::atomic_store_explicit(&lck->lk.owner_id, gtid + 1, in __kmp_acquire_nested_ticket_lock()
827 kmp_int32 gtid) { in __kmp_acquire_nested_ticket_lock_with_checks() argument
840 return __kmp_acquire_nested_ticket_lock(lck, gtid); in __kmp_acquire_nested_ticket_lock_with_checks()
843 int __kmp_test_nested_ticket_lock(kmp_ticket_lock_t *lck, kmp_int32 gtid) { in __kmp_test_nested_ticket_lock() argument
846 KMP_DEBUG_ASSERT(gtid >= 0); in __kmp_test_nested_ticket_lock()
848 if (__kmp_get_ticket_lock_owner(lck) == gtid) { in __kmp_test_nested_ticket_lock()
852 } else if (!__kmp_test_ticket_lock(lck, gtid)) { in __kmp_test_nested_ticket_lock()
857 std::atomic_store_explicit(&lck->lk.owner_id, gtid + 1, in __kmp_test_nested_ticket_lock()
865 kmp_int32 gtid) { in __kmp_test_nested_ticket_lock_with_checks() argument
878 return __kmp_test_nested_ticket_lock(lck, gtid); in __kmp_test_nested_ticket_lock_with_checks()
881 int __kmp_release_nested_ticket_lock(kmp_ticket_lock_t *lck, kmp_int32 gtid) { in __kmp_release_nested_ticket_lock() argument
882 KMP_DEBUG_ASSERT(gtid >= 0); in __kmp_release_nested_ticket_lock()
888 __kmp_release_ticket_lock(lck, gtid); in __kmp_release_nested_ticket_lock()
895 kmp_int32 gtid) { in __kmp_release_nested_ticket_lock_with_checks() argument
911 if (__kmp_get_ticket_lock_owner(lck) != gtid) { in __kmp_release_nested_ticket_lock_with_checks()
914 return __kmp_release_nested_ticket_lock(lck, gtid); in __kmp_release_nested_ticket_lock_with_checks()
1039 static void __kmp_dump_queuing_lock(kmp_info_t *this_thr, kmp_int32 gtid, in __kmp_dump_queuing_lock() argument
1057 gtid + 1, this_thr->th.th_spin_here, in __kmp_dump_queuing_lock()
1089 kmp_int32 gtid) { in __kmp_acquire_queuing_lock_timed_template() argument
1090 kmp_info_t *this_thr = __kmp_thread_from_gtid(gtid); in __kmp_acquire_queuing_lock_timed_template()
1101 ("__kmp_acquire_queuing_lock: lck:%p, T#%d entering\n", lck, gtid)); in __kmp_acquire_queuing_lock_timed_template()
1108 TRACE_LOCK(gtid + 1, "acq ent"); in __kmp_acquire_queuing_lock_timed_template()
1110 __kmp_dump_queuing_lock(this_thr, gtid, lck, *head_id_p, *tail_id_p); in __kmp_acquire_queuing_lock_timed_template()
1112 __kmp_dump_queuing_lock(this_thr, gtid, lck, *head_id_p, *tail_id_p); in __kmp_acquire_queuing_lock_timed_template()
1138 TRACE_LOCK_HT(gtid + 1, "acq read: ", head, tail); in __kmp_acquire_queuing_lock_timed_template()
1149 KMP_PACK_64(gtid + 1, gtid + 1)); in __kmp_acquire_queuing_lock_timed_template()
1152 TRACE_LOCK(gtid + 1, "acq enq: (-1,0)->(tid,tid)"); in __kmp_acquire_queuing_lock_timed_template()
1158 KMP_DEBUG_ASSERT(tail != gtid + 1); in __kmp_acquire_queuing_lock_timed_template()
1161 TRACE_LOCK_HT(gtid + 1, "acq read: ", head, tail); in __kmp_acquire_queuing_lock_timed_template()
1169 enqueued = KMP_COMPARE_AND_STORE_ACQ32(tail_id_p, tail, gtid + 1); in __kmp_acquire_queuing_lock_timed_template()
1173 TRACE_LOCK(gtid + 1, "acq enq: (h,t)->(h,tid)"); in __kmp_acquire_queuing_lock_timed_template()
1184 TRACE_LOCK_HT(gtid + 1, "acq read: ", head, tail); in __kmp_acquire_queuing_lock_timed_template()
1199 lck, gtid)); in __kmp_acquire_queuing_lock_timed_template()
1201 TRACE_LOCK_HT(gtid + 1, "acq exit: ", head, 0); in __kmp_acquire_queuing_lock_timed_template()
1232 tail_thr->th.th_next_waiting = gtid + 1; in __kmp_acquire_queuing_lock_timed_template()
1237 lck, gtid)); in __kmp_acquire_queuing_lock_timed_template()
1247 TRACE_LOCK(gtid + 1, "acq spin"); in __kmp_acquire_queuing_lock_timed_template()
1250 __kmp_dump_queuing_lock(this_thr, gtid, lck, *head_id_p, *tail_id_p); in __kmp_acquire_queuing_lock_timed_template()
1255 lck, gtid)); in __kmp_acquire_queuing_lock_timed_template()
1258 TRACE_LOCK(gtid + 1, "acq exit 2"); in __kmp_acquire_queuing_lock_timed_template()
1277 TRACE_LOCK(gtid + 1, "acq retry"); in __kmp_acquire_queuing_lock_timed_template()
1284 int __kmp_acquire_queuing_lock(kmp_queuing_lock_t *lck, kmp_int32 gtid) { in __kmp_acquire_queuing_lock() argument
1285 KMP_DEBUG_ASSERT(gtid >= 0); in __kmp_acquire_queuing_lock()
1287 int retval = __kmp_acquire_queuing_lock_timed_template<false>(lck, gtid); in __kmp_acquire_queuing_lock()
1293 kmp_int32 gtid) { in __kmp_acquire_queuing_lock_with_checks() argument
1301 if (__kmp_get_queuing_lock_owner(lck) == gtid) { in __kmp_acquire_queuing_lock_with_checks()
1305 __kmp_acquire_queuing_lock(lck, gtid); in __kmp_acquire_queuing_lock_with_checks()
1307 lck->lk.owner_id = gtid + 1; in __kmp_acquire_queuing_lock_with_checks()
1311 int __kmp_test_queuing_lock(kmp_queuing_lock_t *lck, kmp_int32 gtid) { in __kmp_test_queuing_lock() argument
1318 KA_TRACE(1000, ("__kmp_test_queuing_lock: T#%d entering\n", gtid)); in __kmp_test_queuing_lock()
1319 KMP_DEBUG_ASSERT(gtid >= 0); in __kmp_test_queuing_lock()
1321 this_thr = __kmp_thread_from_gtid(gtid); in __kmp_test_queuing_lock()
1332 ("__kmp_test_queuing_lock: T#%d exiting: holding lock\n", gtid)); in __kmp_test_queuing_lock()
1340 ("__kmp_test_queuing_lock: T#%d exiting: without lock\n", gtid)); in __kmp_test_queuing_lock()
1345 kmp_int32 gtid) { in __kmp_test_queuing_lock_with_checks() argument
1354 int retval = __kmp_test_queuing_lock(lck, gtid); in __kmp_test_queuing_lock_with_checks()
1357 lck->lk.owner_id = gtid + 1; in __kmp_test_queuing_lock_with_checks()
1362 int __kmp_release_queuing_lock(kmp_queuing_lock_t *lck, kmp_int32 gtid) { in __kmp_release_queuing_lock() argument
1368 ("__kmp_release_queuing_lock: lck:%p, T#%d entering\n", lck, gtid)); in __kmp_release_queuing_lock()
1369 KMP_DEBUG_ASSERT(gtid >= 0); in __kmp_release_queuing_lock()
1370 this_thr = __kmp_thread_from_gtid(gtid); in __kmp_release_queuing_lock()
1373 TRACE_LOCK(gtid + 1, "rel ent"); in __kmp_release_queuing_lock()
1376 __kmp_dump_queuing_lock(this_thr, gtid, lck, *head_id_p, *tail_id_p); in __kmp_release_queuing_lock()
1378 __kmp_dump_queuing_lock(this_thr, gtid, lck, *head_id_p, *tail_id_p); in __kmp_release_queuing_lock()
1395 TRACE_LOCK_HT(gtid + 1, "rel read: ", head, tail); in __kmp_release_queuing_lock()
1397 __kmp_dump_queuing_lock(this_thr, gtid, lck, head, tail); in __kmp_release_queuing_lock()
1408 lck, gtid)); in __kmp_release_queuing_lock()
1410 TRACE_LOCK_HT(gtid + 1, "rel exit: ", 0, 0); in __kmp_release_queuing_lock()
1425 __kmp_dump_queuing_lock(this_thr, gtid, lck, head, tail); in __kmp_release_queuing_lock()
1434 TRACE_LOCK(gtid + 1, "rel deq: (h,h)->(-1,0)"); in __kmp_release_queuing_lock()
1446 __kmp_dump_queuing_lock(this_thr, gtid, lck, head, tail); in __kmp_release_queuing_lock()
1457 TRACE_LOCK(gtid + 1, "rel deq: (h,t)->(h',t)"); in __kmp_release_queuing_lock()
1470 __kmp_dump_queuing_lock(this_thr, gtid, lck, head, tail); in __kmp_release_queuing_lock()
1478 TRACE_LOCK_T(gtid + 1, "rel nw=0 for t=", head); in __kmp_release_queuing_lock()
1487 lck, gtid)); in __kmp_release_queuing_lock()
1489 TRACE_LOCK(gtid + 1, "rel exit 2"); in __kmp_release_queuing_lock()
1497 TRACE_LOCK(gtid + 1, "rel retry"); in __kmp_release_queuing_lock()
1506 kmp_int32 gtid) { in __kmp_release_queuing_lock_with_checks() argument
1518 if (__kmp_get_queuing_lock_owner(lck) != gtid) { in __kmp_release_queuing_lock_with_checks()
1522 return __kmp_release_queuing_lock(lck, gtid); in __kmp_release_queuing_lock_with_checks()
1565 int __kmp_acquire_nested_queuing_lock(kmp_queuing_lock_t *lck, kmp_int32 gtid) { in __kmp_acquire_nested_queuing_lock() argument
1566 KMP_DEBUG_ASSERT(gtid >= 0); in __kmp_acquire_nested_queuing_lock()
1568 if (__kmp_get_queuing_lock_owner(lck) == gtid) { in __kmp_acquire_nested_queuing_lock()
1572 __kmp_acquire_queuing_lock_timed_template<false>(lck, gtid); in __kmp_acquire_nested_queuing_lock()
1577 lck->lk.owner_id = gtid + 1; in __kmp_acquire_nested_queuing_lock()
1584 kmp_int32 gtid) { in __kmp_acquire_nested_queuing_lock_with_checks() argument
1592 return __kmp_acquire_nested_queuing_lock(lck, gtid); in __kmp_acquire_nested_queuing_lock_with_checks()
1595 int __kmp_test_nested_queuing_lock(kmp_queuing_lock_t *lck, kmp_int32 gtid) { in __kmp_test_nested_queuing_lock() argument
1598 KMP_DEBUG_ASSERT(gtid >= 0); in __kmp_test_nested_queuing_lock()
1600 if (__kmp_get_queuing_lock_owner(lck) == gtid) { in __kmp_test_nested_queuing_lock()
1602 } else if (!__kmp_test_queuing_lock(lck, gtid)) { in __kmp_test_nested_queuing_lock()
1608 lck->lk.owner_id = gtid + 1; in __kmp_test_nested_queuing_lock()
1614 kmp_int32 gtid) { in __kmp_test_nested_queuing_lock_with_checks() argument
1622 return __kmp_test_nested_queuing_lock(lck, gtid); in __kmp_test_nested_queuing_lock_with_checks()
1625 int __kmp_release_nested_queuing_lock(kmp_queuing_lock_t *lck, kmp_int32 gtid) { in __kmp_release_nested_queuing_lock() argument
1626 KMP_DEBUG_ASSERT(gtid >= 0); in __kmp_release_nested_queuing_lock()
1632 __kmp_release_queuing_lock(lck, gtid); in __kmp_release_nested_queuing_lock()
1640 kmp_int32 gtid) { in __kmp_release_nested_queuing_lock_with_checks() argument
1652 if (__kmp_get_queuing_lock_owner(lck) != gtid) { in __kmp_release_nested_queuing_lock_with_checks()
1655 return __kmp_release_nested_queuing_lock(lck, gtid); in __kmp_release_nested_queuing_lock_with_checks()
2004 kmp_int32 gtid) { in __kmp_should_speculate() argument
2015 kmp_int32 gtid) { in __kmp_test_adaptive_lock_only() argument
2062 static int __kmp_test_adaptive_lock(kmp_adaptive_lock_t *lck, kmp_int32 gtid) { in __kmp_test_adaptive_lock() argument
2064 if (__kmp_should_speculate(lck, gtid) && in __kmp_test_adaptive_lock()
2065 __kmp_test_adaptive_lock_only(lck, gtid)) in __kmp_test_adaptive_lock()
2073 if (__kmp_test_queuing_lock(GET_QLK_PTR(lck), gtid)) { in __kmp_test_adaptive_lock()
2082 kmp_int32 gtid) { in __kmp_test_adaptive_lock_with_checks() argument
2088 int retval = __kmp_test_adaptive_lock(lck, gtid); in __kmp_test_adaptive_lock_with_checks()
2091 lck->lk.qlk.owner_id = gtid + 1; in __kmp_test_adaptive_lock_with_checks()
2108 kmp_int32 gtid) { in __kmp_acquire_adaptive_lock() argument
2109 if (__kmp_should_speculate(lck, gtid)) { in __kmp_acquire_adaptive_lock()
2111 if (__kmp_test_adaptive_lock_only(lck, gtid)) in __kmp_acquire_adaptive_lock()
2125 if (__kmp_test_adaptive_lock_only(lck, gtid)) in __kmp_acquire_adaptive_lock()
2134 __kmp_acquire_queuing_lock_timed_template<FALSE>(GET_QLK_PTR(lck), gtid); in __kmp_acquire_adaptive_lock()
2141 kmp_int32 gtid) { in __kmp_acquire_adaptive_lock_with_checks() argument
2146 if (__kmp_get_queuing_lock_owner(GET_QLK_PTR(lck)) == gtid) { in __kmp_acquire_adaptive_lock_with_checks()
2150 __kmp_acquire_adaptive_lock(lck, gtid); in __kmp_acquire_adaptive_lock_with_checks()
2152 lck->lk.qlk.owner_id = gtid + 1; in __kmp_acquire_adaptive_lock_with_checks()
2157 kmp_int32 gtid) { in __kmp_release_adaptive_lock() argument
2166 __kmp_release_queuing_lock(GET_QLK_PTR(lck), gtid); in __kmp_release_adaptive_lock()
2172 kmp_int32 gtid) { in __kmp_release_adaptive_lock_with_checks() argument
2181 if (__kmp_get_queuing_lock_owner(GET_QLK_PTR(lck)) != gtid) { in __kmp_release_adaptive_lock_with_checks()
2185 __kmp_release_adaptive_lock(lck, gtid); in __kmp_release_adaptive_lock_with_checks()
2236 __kmp_acquire_drdpa_lock_timed_template(kmp_drdpa_lock_t *lck, kmp_int32 gtid) { in __kmp_acquire_drdpa_lock_timed_template() argument
2368 int __kmp_acquire_drdpa_lock(kmp_drdpa_lock_t *lck, kmp_int32 gtid) { in __kmp_acquire_drdpa_lock() argument
2369 int retval = __kmp_acquire_drdpa_lock_timed_template(lck, gtid); in __kmp_acquire_drdpa_lock()
2375 kmp_int32 gtid) { in __kmp_acquire_drdpa_lock_with_checks() argument
2383 if ((gtid >= 0) && (__kmp_get_drdpa_lock_owner(lck) == gtid)) { in __kmp_acquire_drdpa_lock_with_checks()
2387 __kmp_acquire_drdpa_lock(lck, gtid); in __kmp_acquire_drdpa_lock_with_checks()
2389 lck->lk.owner_id = gtid + 1; in __kmp_acquire_drdpa_lock_with_checks()
2393 int __kmp_test_drdpa_lock(kmp_drdpa_lock_t *lck, kmp_int32 gtid) { in __kmp_test_drdpa_lock() argument
2421 kmp_int32 gtid) { in __kmp_test_drdpa_lock_with_checks() argument
2430 int retval = __kmp_test_drdpa_lock(lck, gtid); in __kmp_test_drdpa_lock_with_checks()
2433 lck->lk.owner_id = gtid + 1; in __kmp_test_drdpa_lock_with_checks()
2438 int __kmp_release_drdpa_lock(kmp_drdpa_lock_t *lck, kmp_int32 gtid) { in __kmp_release_drdpa_lock() argument
2453 kmp_int32 gtid) { in __kmp_release_drdpa_lock_with_checks() argument
2465 if ((gtid >= 0) && (__kmp_get_drdpa_lock_owner(lck) >= 0) && in __kmp_release_drdpa_lock_with_checks()
2466 (__kmp_get_drdpa_lock_owner(lck) != gtid)) { in __kmp_release_drdpa_lock_with_checks()
2470 return __kmp_release_drdpa_lock(lck, gtid); in __kmp_release_drdpa_lock_with_checks()
2526 int __kmp_acquire_nested_drdpa_lock(kmp_drdpa_lock_t *lck, kmp_int32 gtid) { in __kmp_acquire_nested_drdpa_lock() argument
2527 KMP_DEBUG_ASSERT(gtid >= 0); in __kmp_acquire_nested_drdpa_lock()
2529 if (__kmp_get_drdpa_lock_owner(lck) == gtid) { in __kmp_acquire_nested_drdpa_lock()
2533 __kmp_acquire_drdpa_lock_timed_template(lck, gtid); in __kmp_acquire_nested_drdpa_lock()
2538 lck->lk.owner_id = gtid + 1; in __kmp_acquire_nested_drdpa_lock()
2544 kmp_int32 gtid) { in __kmp_acquire_nested_drdpa_lock_with_checks() argument
2552 __kmp_acquire_nested_drdpa_lock(lck, gtid); in __kmp_acquire_nested_drdpa_lock_with_checks()
2555 int __kmp_test_nested_drdpa_lock(kmp_drdpa_lock_t *lck, kmp_int32 gtid) { in __kmp_test_nested_drdpa_lock() argument
2558 KMP_DEBUG_ASSERT(gtid >= 0); in __kmp_test_nested_drdpa_lock()
2560 if (__kmp_get_drdpa_lock_owner(lck) == gtid) { in __kmp_test_nested_drdpa_lock()
2562 } else if (!__kmp_test_drdpa_lock(lck, gtid)) { in __kmp_test_nested_drdpa_lock()
2568 lck->lk.owner_id = gtid + 1; in __kmp_test_nested_drdpa_lock()
2574 kmp_int32 gtid) { in __kmp_test_nested_drdpa_lock_with_checks() argument
2582 return __kmp_test_nested_drdpa_lock(lck, gtid); in __kmp_test_nested_drdpa_lock_with_checks()
2585 int __kmp_release_nested_drdpa_lock(kmp_drdpa_lock_t *lck, kmp_int32 gtid) { in __kmp_release_nested_drdpa_lock() argument
2586 KMP_DEBUG_ASSERT(gtid >= 0); in __kmp_release_nested_drdpa_lock()
2592 __kmp_release_drdpa_lock(lck, gtid); in __kmp_release_nested_drdpa_lock()
2599 kmp_int32 gtid) { in __kmp_release_nested_drdpa_lock_with_checks() argument
2611 if (__kmp_get_drdpa_lock_owner(lck) != gtid) { in __kmp_release_nested_drdpa_lock_with_checks()
2614 return __kmp_release_nested_drdpa_lock(lck, gtid); in __kmp_release_nested_drdpa_lock_with_checks()
2726 static void __kmp_acquire_hle_lock(kmp_dyna_lock_t *lck, kmp_int32 gtid) { in __kmp_acquire_hle_lock() argument
2741 kmp_int32 gtid) { in __kmp_acquire_hle_lock_with_checks() argument
2742 __kmp_acquire_hle_lock(lck, gtid); // TODO: add checks in __kmp_acquire_hle_lock_with_checks()
2745 static int __kmp_release_hle_lock(kmp_dyna_lock_t *lck, kmp_int32 gtid) { in __kmp_release_hle_lock() argument
2754 kmp_int32 gtid) { in __kmp_release_hle_lock_with_checks() argument
2755 return __kmp_release_hle_lock(lck, gtid); // TODO: add checks in __kmp_release_hle_lock_with_checks()
2758 static int __kmp_test_hle_lock(kmp_dyna_lock_t *lck, kmp_int32 gtid) { in __kmp_test_hle_lock() argument
2763 kmp_int32 gtid) { in __kmp_test_hle_lock_with_checks() argument
2764 return __kmp_test_hle_lock(lck, gtid); // TODO: add checks in __kmp_test_hle_lock_with_checks()
2780 static void __kmp_acquire_rtm_lock(kmp_queuing_lock_t *lck, kmp_int32 gtid) { in __kmp_acquire_rtm_lock() argument
2799 __kmp_acquire_queuing_lock(lck, gtid); in __kmp_acquire_rtm_lock()
2803 kmp_int32 gtid) { in __kmp_acquire_rtm_lock_with_checks() argument
2804 __kmp_acquire_rtm_lock(lck, gtid); in __kmp_acquire_rtm_lock_with_checks()
2808 static int __kmp_release_rtm_lock(kmp_queuing_lock_t *lck, kmp_int32 gtid) { in __kmp_release_rtm_lock() argument
2814 __kmp_release_queuing_lock(lck, gtid); in __kmp_release_rtm_lock()
2820 kmp_int32 gtid) { in __kmp_release_rtm_lock_with_checks() argument
2821 return __kmp_release_rtm_lock(lck, gtid); in __kmp_release_rtm_lock_with_checks()
2825 static int __kmp_test_rtm_lock(kmp_queuing_lock_t *lck, kmp_int32 gtid) { in __kmp_test_rtm_lock() argument
2840 kmp_int32 gtid) { in __kmp_test_rtm_lock_with_checks() argument
2841 return __kmp_test_rtm_lock(lck, gtid); in __kmp_test_rtm_lock_with_checks()
2869 kmp_int32 gtid) { \
2870 return __kmp_##op##_##lk##_##lock(&lock->lk, gtid); \
3032 kmp_int32 gtid, in __kmp_allocate_indirect_lock() argument
3037 __kmp_acquire_lock(&__kmp_global_lock, gtid); in __kmp_allocate_indirect_lock()
3074 __kmp_release_lock(&__kmp_global_lock, gtid); in __kmp_allocate_indirect_lock()
3141 kmp_uint32 gtid = __kmp_entry_gtid(); in __kmp_destroy_indirect_lock() local
3147 __kmp_acquire_lock(&__kmp_global_lock, gtid); in __kmp_destroy_indirect_lock()
3156 __kmp_release_lock(&__kmp_global_lock, gtid); in __kmp_destroy_indirect_lock()
3159 static int __kmp_set_indirect_lock(kmp_dyna_lock_t *lock, kmp_int32 gtid) { in __kmp_set_indirect_lock() argument
3161 return KMP_I_LOCK_FUNC(l, set)(l->lock, gtid); in __kmp_set_indirect_lock()
3164 static int __kmp_unset_indirect_lock(kmp_dyna_lock_t *lock, kmp_int32 gtid) { in __kmp_unset_indirect_lock() argument
3166 return KMP_I_LOCK_FUNC(l, unset)(l->lock, gtid); in __kmp_unset_indirect_lock()
3169 static int __kmp_test_indirect_lock(kmp_dyna_lock_t *lock, kmp_int32 gtid) { in __kmp_test_indirect_lock() argument
3171 return KMP_I_LOCK_FUNC(l, test)(l->lock, gtid); in __kmp_test_indirect_lock()
3175 kmp_int32 gtid) { in __kmp_set_indirect_lock_with_checks() argument
3178 return KMP_I_LOCK_FUNC(l, set)(l->lock, gtid); in __kmp_set_indirect_lock_with_checks()
3182 kmp_int32 gtid) { in __kmp_unset_indirect_lock_with_checks() argument
3185 return KMP_I_LOCK_FUNC(l, unset)(l->lock, gtid); in __kmp_unset_indirect_lock_with_checks()
3189 kmp_int32 gtid) { in __kmp_test_indirect_lock_with_checks() argument
3192 return KMP_I_LOCK_FUNC(l, test)(l->lock, gtid); in __kmp_test_indirect_lock_with_checks()
3439 kmp_int32 gtid) = NULL;
3442 kmp_int32 gtid) = NULL;
3444 kmp_int32 gtid) = NULL;
3449 kmp_int32 gtid) = NULL;
3452 kmp_int32 gtid) = NULL;
3454 kmp_int32 gtid) = NULL;
3746 kmp_user_lock_p __kmp_user_lock_allocate(void **user_lock, kmp_int32 gtid, in __kmp_user_lock_allocate() argument
3752 __kmp_acquire_lock(&__kmp_global_lock, gtid); in __kmp_user_lock_allocate()
3788 __kmp_release_lock(&__kmp_global_lock, gtid); // AC: TODO move this line upper in __kmp_user_lock_allocate()
3794 void __kmp_user_lock_free(void **user_lock, kmp_int32 gtid, in __kmp_user_lock_free() argument
3799 __kmp_acquire_lock(&__kmp_global_lock, gtid); in __kmp_user_lock_free()
3809 __kmp_release_lock(&__kmp_global_lock, gtid); in __kmp_user_lock_free()