Lines Matching refs:thr

164 ThreadId map_threads_maybe_reverse_lookup_SLOW ( Thread* thr ); /*fwds*/
239 static void lockN_acquire_writer ( Lock* lk, Thread* thr ) in lockN_acquire_writer() argument
242 tl_assert(HG_(is_sane_Thread)(thr)); in lockN_acquire_writer()
252 tid = map_threads_maybe_reverse_lookup_SLOW(thr); in lockN_acquire_writer()
267 VG_(addToBag)( lk->heldBy, (UWord)thr ); in lockN_acquire_writer()
277 tl_assert(VG_(elemBag)(lk->heldBy, (UWord)thr) in lockN_acquire_writer()
279 VG_(addToBag)(lk->heldBy, (UWord)thr); in lockN_acquire_writer()
290 static void lockN_acquire_reader ( Lock* lk, Thread* thr ) in lockN_acquire_reader() argument
293 tl_assert(HG_(is_sane_Thread)(thr)); in lockN_acquire_reader()
308 tid = map_threads_maybe_reverse_lookup_SLOW(thr); in lockN_acquire_reader()
317 VG_(addToBag)(lk->heldBy, (UWord)thr); in lockN_acquire_reader()
321 VG_(addToBag)( lk->heldBy, (UWord)thr ); in lockN_acquire_reader()
331 static void lockN_release ( Lock* lk, Thread* thr ) in lockN_release() argument
335 tl_assert(HG_(is_sane_Thread)(thr)); in lockN_release()
340 b = VG_(delFromBag)(lk->heldBy, (UWord)thr); in lockN_release()
356 Thread* thr; in remove_Lock_from_locksets_of_all_owning_Threads() local
363 while (VG_(nextIterBag)( lk->heldBy, (UWord*)&thr, NULL )) { in remove_Lock_from_locksets_of_all_owning_Threads()
364 tl_assert(HG_(is_sane_Thread)(thr)); in remove_Lock_from_locksets_of_all_owning_Threads()
366 thr->locksetA, (UWord)lk )); in remove_Lock_from_locksets_of_all_owning_Threads()
367 thr->locksetA in remove_Lock_from_locksets_of_all_owning_Threads()
368 = HG_(delFromWS)( univ_lsets, thr->locksetA, (UWord)lk ); in remove_Lock_from_locksets_of_all_owning_Threads()
372 thr->locksetW, (UWord)lk )); in remove_Lock_from_locksets_of_all_owning_Threads()
373 thr->locksetW in remove_Lock_from_locksets_of_all_owning_Threads()
374 = HG_(delFromWS)( univ_lsets, thr->locksetW, (UWord)lk ); in remove_Lock_from_locksets_of_all_owning_Threads()
497 Thread* thr; in pp_Lock() local
501 while (VG_(nextIterBag)( lk->heldBy, (UWord*)&thr, &count )) { in pp_Lock()
503 VG_(printf)("%lu:%p ", count, thr); in pp_Lock()
507 count, thr->errmsg_index); in pp_Lock()
508 if (thr->coretid == VG_INVALID_THREADID) in pp_Lock()
511 VG_(printf)("tid %d ", thr->coretid); in pp_Lock()
589 Thread* thr; in initialise_data_structures() local
625 thr = mk_Thread(hbthr_root); in initialise_data_structures()
626 thr->coretid = 1; /* FIXME: hardwires an assumption about the in initialise_data_structures()
629 libhb_set_Thr_hgthread(hbthr_root, thr); in initialise_data_structures()
632 tl_assert(HG_(is_sane_ThreadId)(thr->coretid)); in initialise_data_structures()
633 tl_assert(thr->coretid != VG_INVALID_THREADID); in initialise_data_structures()
635 map_threads[thr->coretid] = thr; in initialise_data_structures()
650 Thread* thr; in map_threads_maybe_lookup() local
652 thr = map_threads[coretid]; in map_threads_maybe_lookup()
653 return thr; in map_threads_maybe_lookup()
659 Thread* thr; in map_threads_lookup() local
661 thr = map_threads[coretid]; in map_threads_lookup()
662 tl_assert(thr); in map_threads_lookup()
663 return thr; in map_threads_lookup()
668 static ThreadId map_threads_maybe_reverse_lookup_SLOW ( Thread* thr ) in map_threads_maybe_reverse_lookup_SLOW() argument
671 tl_assert(HG_(is_sane_Thread)(thr)); in map_threads_maybe_reverse_lookup_SLOW()
675 tid = thr->coretid; in map_threads_maybe_reverse_lookup_SLOW()
682 static ThreadId map_threads_reverse_lookup_SLOW ( Thread* thr ) in map_threads_reverse_lookup_SLOW() argument
684 ThreadId tid = map_threads_maybe_reverse_lookup_SLOW( thr ); in map_threads_reverse_lookup_SLOW()
693 Thread* thr; in map_threads_delete() local
696 thr = map_threads[coretid]; in map_threads_delete()
697 tl_assert(thr); in map_threads_delete()
835 static Bool thread_is_a_holder_of_Lock ( Thread* thr, Lock* lk ) in thread_is_a_holder_of_Lock() argument
838 return VG_(elemBag)( lk->heldBy, (UWord)thr ) > 0; in thread_is_a_holder_of_Lock()
849 Thread* thr; in threads__sanity_check() local
854 for (thr = admin_threads; thr; thr = thr->admin) { in threads__sanity_check()
855 if (!HG_(is_sane_Thread)(thr)) BAD("1"); in threads__sanity_check()
856 wsA = thr->locksetA; in threads__sanity_check()
857 wsW = thr->locksetW; in threads__sanity_check()
867 if (!thread_is_a_holder_of_Lock(thr,lk)) BAD("3"); in threads__sanity_check()
909 Thread* thr; in locks__sanity_check() local
913 (UWord*)&thr, &count )) { in locks__sanity_check()
916 tl_assert(HG_(is_sane_Thread)(thr)); in locks__sanity_check()
917 if (!HG_(elemWS)(univ_lsets, thr->locksetA, (UWord)lk)) in locks__sanity_check()
921 && !HG_(elemWS)(univ_lsets, thr->locksetW, (UWord)lk)) in locks__sanity_check()
924 && HG_(elemWS)(univ_lsets, thr->locksetW, (UWord)lk)) in locks__sanity_check()
971 static void shadow_mem_scopy_range ( Thread* thr, in shadow_mem_scopy_range() argument
974 Thr* hbthr = thr->hbthr; in shadow_mem_scopy_range()
979 static void shadow_mem_cread_range ( Thread* thr, Addr a, SizeT len ) in shadow_mem_cread_range() argument
981 Thr* hbthr = thr->hbthr; in shadow_mem_cread_range()
986 static void shadow_mem_cwrite_range ( Thread* thr, Addr a, SizeT len ) { in shadow_mem_cwrite_range() argument
987 Thr* hbthr = thr->hbthr; in shadow_mem_cwrite_range()
992 static void shadow_mem_make_New ( Thread* thr, Addr a, SizeT len ) in shadow_mem_make_New() argument
994 libhb_srange_new( thr->hbthr, a, len ); in shadow_mem_make_New()
997 static void shadow_mem_make_NoAccess_NoFX ( Thread* thr, Addr aIN, SizeT len ) in shadow_mem_make_NoAccess_NoFX() argument
1002 libhb_srange_noaccess_NoFX( thr->hbthr, aIN, len ); in shadow_mem_make_NoAccess_NoFX()
1005 static void shadow_mem_make_NoAccess_AHAE ( Thread* thr, Addr aIN, SizeT len ) in shadow_mem_make_NoAccess_AHAE() argument
1010 libhb_srange_noaccess_AHAE( thr->hbthr, aIN, len ); in shadow_mem_make_NoAccess_AHAE()
1013 static void shadow_mem_make_Untracked ( Thread* thr, Addr aIN, SizeT len ) in shadow_mem_make_Untracked() argument
1017 libhb_srange_untrack( thr->hbthr, aIN, len ); in shadow_mem_make_Untracked()
1055 void evhH__post_thread_w_acquires_lock ( Thread* thr, in evhH__post_thread_w_acquires_lock() argument
1071 tl_assert(HG_(is_sane_Thread)(thr)); in evhH__post_thread_w_acquires_lock()
1075 lkk, lock_ga, map_threads_reverse_lookup_SLOW(thr) ); in evhH__post_thread_w_acquires_lock()
1079 tl_assert(thr->hbthr); in evhH__post_thread_w_acquires_lock()
1085 lockN_acquire_writer( lk, thr ); in evhH__post_thread_w_acquires_lock()
1087 libhb_so_recv( thr->hbthr, lk->hbso, True/*strong_recv*/ ); in evhH__post_thread_w_acquires_lock()
1096 thr, "Bug in libpthread: write lock " in evhH__post_thread_w_acquires_lock()
1105 if (thr != (Thread*)VG_(anyElementOfBag)(lk->heldBy)) { in evhH__post_thread_w_acquires_lock()
1107 thr, "Bug in libpthread: write lock " in evhH__post_thread_w_acquires_lock()
1120 thr, "Bug in libpthread: recursive write lock " in evhH__post_thread_w_acquires_lock()
1127 lockN_acquire_writer( lk, thr ); in evhH__post_thread_w_acquires_lock()
1130 libhb_so_recv( thr->hbthr, lk->hbso, True/*strong_recv*/ ); in evhH__post_thread_w_acquires_lock()
1137 laog__pre_thread_acquires_lock( thr, lk ); in evhH__post_thread_w_acquires_lock()
1140 thr->locksetA = HG_(addToWS)( univ_lsets, thr->locksetA, (UWord)lk ); in evhH__post_thread_w_acquires_lock()
1141 thr->locksetW = HG_(addToWS)( univ_lsets, thr->locksetW, (UWord)lk ); in evhH__post_thread_w_acquires_lock()
1152 void evhH__post_thread_r_acquires_lock ( Thread* thr, in evhH__post_thread_r_acquires_lock() argument
1168 tl_assert(HG_(is_sane_Thread)(thr)); in evhH__post_thread_r_acquires_lock()
1174 lkk, lock_ga, map_threads_reverse_lookup_SLOW(thr) ); in evhH__post_thread_r_acquires_lock()
1178 tl_assert(thr->hbthr); in evhH__post_thread_r_acquires_lock()
1184 lockN_acquire_reader( lk, thr ); in evhH__post_thread_r_acquires_lock()
1186 libhb_so_recv( thr->hbthr, lk->hbso, False/*!strong_recv*/ ); in evhH__post_thread_r_acquires_lock()
1194 HG_(record_error_Misc)( thr, "Bug in libpthread: read lock " in evhH__post_thread_r_acquires_lock()
1202 lockN_acquire_reader( lk, thr ); in evhH__post_thread_r_acquires_lock()
1205 libhb_so_recv( thr->hbthr, lk->hbso, False/*!strong_recv*/ ); in evhH__post_thread_r_acquires_lock()
1212 laog__pre_thread_acquires_lock( thr, lk ); in evhH__post_thread_r_acquires_lock()
1215 thr->locksetA = HG_(addToWS)( univ_lsets, thr->locksetA, (UWord)lk ); in evhH__post_thread_r_acquires_lock()
1227 void evhH__pre_thread_releases_lock ( Thread* thr, in evhH__pre_thread_releases_lock() argument
1243 tl_assert(HG_(is_sane_Thread)(thr)); in evhH__pre_thread_releases_lock()
1250 HG_(record_error_UnlockBogus)( thr, lock_ga ); in evhH__pre_thread_releases_lock()
1258 HG_(record_error_Misc)( thr, "pthread_rwlock_unlock with a " in evhH__pre_thread_releases_lock()
1262 HG_(record_error_Misc)( thr, "pthread_mutex_unlock with a " in evhH__pre_thread_releases_lock()
1270 HG_(record_error_UnlockUnlocked)( thr, lock ); in evhH__pre_thread_releases_lock()
1271 tl_assert(!HG_(elemWS)( univ_lsets, thr->locksetA, (UWord)lock )); in evhH__pre_thread_releases_lock()
1272 tl_assert(!HG_(elemWS)( univ_lsets, thr->locksetW, (UWord)lock )); in evhH__pre_thread_releases_lock()
1282 n = VG_(elemBag)( lock->heldBy, (UWord)thr ); in evhH__pre_thread_releases_lock()
1291 tl_assert(realOwner != thr); in evhH__pre_thread_releases_lock()
1292 tl_assert(!HG_(elemWS)( univ_lsets, thr->locksetA, (UWord)lock )); in evhH__pre_thread_releases_lock()
1293 tl_assert(!HG_(elemWS)( univ_lsets, thr->locksetW, (UWord)lock )); in evhH__pre_thread_releases_lock()
1294 HG_(record_error_UnlockForeign)( thr, realOwner, lock ); in evhH__pre_thread_releases_lock()
1301 lockN_release( lock, thr ); in evhH__pre_thread_releases_lock()
1308 tl_assert(n == VG_(elemBag)( lock->heldBy, (UWord)thr )); in evhH__pre_thread_releases_lock()
1313 tl_assert(HG_(elemWS)( univ_lsets, thr->locksetA, (UWord)lock )); in evhH__pre_thread_releases_lock()
1315 tl_assert(HG_(elemWS)( univ_lsets, thr->locksetW, (UWord)lock )); in evhH__pre_thread_releases_lock()
1317 tl_assert(!HG_(elemWS)( univ_lsets, thr->locksetW, (UWord)lock )); in evhH__pre_thread_releases_lock()
1346 thr->locksetA in evhH__pre_thread_releases_lock()
1347 = HG_(delFromWS)( univ_lsets, thr->locksetA, (UWord)lock ); in evhH__pre_thread_releases_lock()
1348 thr->locksetW in evhH__pre_thread_releases_lock()
1349 = HG_(delFromWS)( univ_lsets, thr->locksetW, (UWord)lock ); in evhH__pre_thread_releases_lock()
1351 tl_assert(thr->hbthr); in evhH__pre_thread_releases_lock()
1355 libhb_so_send( thr->hbthr, lock->hbso, was_heldW ); in evhH__pre_thread_releases_lock()
1408 Thread* thr; in get_current_Thread() local
1409 thr = get_current_Thread_in_C_C(); in get_current_Thread()
1410 if (LIKELY(thr)) in get_current_Thread()
1411 return thr; in get_current_Thread()
1420 thr = map_threads_lookup( coretid ); in get_current_Thread()
1421 return thr; in get_current_Thread()
1652 Thread* thr; in evh__atfork_child() local
1654 thr = map_threads_maybe_lookup( 0/*INVALID*/ ); in evh__atfork_child()
1655 tl_assert(!thr); in evh__atfork_child()
1660 thr = map_threads_maybe_lookup(i); in evh__atfork_child()
1661 if (!thr) in evh__atfork_child()
1665 tl_assert(thr->hbthr); in evh__atfork_child()
1666 libhb_async_exit(thr->hbthr); in evh__atfork_child()
1667 tl_assert(thr->coretid == i); in evh__atfork_child()
1668 thr->coretid = VG_INVALID_THREADID; in evh__atfork_child()
1803 Thread* thr; in evh__die_mem_heap() local
1806 thr = get_current_Thread(); in evh__die_mem_heap()
1807 tl_assert(thr); in evh__die_mem_heap()
1814 shadow_mem_cwrite_range(thr, a, len); in evh__die_mem_heap()
1816 shadow_mem_make_NoAccess_AHAE( thr, a, len ); in evh__die_mem_heap()
1846 Thread* thr = get_current_Thread_in_C_C(); in evh__mem_help_cread_1() local
1847 Thr* hbthr = thr->hbthr; in evh__mem_help_cread_1()
1853 Thread* thr = get_current_Thread_in_C_C(); in evh__mem_help_cread_2() local
1854 Thr* hbthr = thr->hbthr; in evh__mem_help_cread_2()
1860 Thread* thr = get_current_Thread_in_C_C(); in evh__mem_help_cread_4() local
1861 Thr* hbthr = thr->hbthr; in evh__mem_help_cread_4()
1867 Thread* thr = get_current_Thread_in_C_C(); in evh__mem_help_cread_8() local
1868 Thr* hbthr = thr->hbthr; in evh__mem_help_cread_8()
1874 Thread* thr = get_current_Thread_in_C_C(); in evh__mem_help_cread_N() local
1875 Thr* hbthr = thr->hbthr; in evh__mem_help_cread_N()
1881 Thread* thr = get_current_Thread_in_C_C(); in evh__mem_help_cwrite_1() local
1882 Thr* hbthr = thr->hbthr; in evh__mem_help_cwrite_1()
1888 Thread* thr = get_current_Thread_in_C_C(); in evh__mem_help_cwrite_2() local
1889 Thr* hbthr = thr->hbthr; in evh__mem_help_cwrite_2()
1895 Thread* thr = get_current_Thread_in_C_C(); in evh__mem_help_cwrite_4() local
1896 Thr* hbthr = thr->hbthr; in evh__mem_help_cwrite_4()
1902 Thread* thr = get_current_Thread_in_C_C(); in evh__mem_help_cwrite_8() local
1903 Thr* hbthr = thr->hbthr; in evh__mem_help_cwrite_8()
1909 Thread* thr = get_current_Thread_in_C_C(); in evh__mem_help_cwrite_N() local
1910 Thr* hbthr = thr->hbthr; in evh__mem_help_cwrite_N()
1941 Thread* thr; in evh__HG_PTHREAD_MUTEX_DESTROY_PRE() local
1948 thr = map_threads_maybe_lookup( tid ); in evh__HG_PTHREAD_MUTEX_DESTROY_PRE()
1950 tl_assert( HG_(is_sane_Thread)(thr) ); in evh__HG_PTHREAD_MUTEX_DESTROY_PRE()
1964 thr, "pthread_mutex_destroy with invalid argument" ); in evh__HG_PTHREAD_MUTEX_DESTROY_PRE()
1973 thr, "pthread_mutex_destroy of a locked mutex" ); in evh__HG_PTHREAD_MUTEX_DESTROY_PRE()
2000 Thread* thr; in evh__HG_PTHREAD_MUTEX_LOCK_PRE() local
2007 thr = map_threads_maybe_lookup( tid ); in evh__HG_PTHREAD_MUTEX_LOCK_PRE()
2008 tl_assert(thr); /* cannot fail - Thread* must already exist */ in evh__HG_PTHREAD_MUTEX_LOCK_PRE()
2013 HG_(record_error_Misc)( thr, "pthread_mutex_lock with a " in evh__HG_PTHREAD_MUTEX_LOCK_PRE()
2022 && VG_(elemBag)( lk->heldBy, (UWord)thr ) > 0 ) { in evh__HG_PTHREAD_MUTEX_LOCK_PRE()
2031 HG_(record_error_Misc_w_aux)( thr, errstr, auxstr, lk->acquired_at ); in evh__HG_PTHREAD_MUTEX_LOCK_PRE()
2033 HG_(record_error_Misc)( thr, errstr ); in evh__HG_PTHREAD_MUTEX_LOCK_PRE()
2041 Thread* thr; in evh__HG_PTHREAD_MUTEX_LOCK_POST() local
2046 thr = map_threads_maybe_lookup( tid ); in evh__HG_PTHREAD_MUTEX_LOCK_POST()
2047 tl_assert(thr); /* cannot fail - Thread* must already exist */ in evh__HG_PTHREAD_MUTEX_LOCK_POST()
2050 thr, in evh__HG_PTHREAD_MUTEX_LOCK_POST()
2059 Thread* thr; in evh__HG_PTHREAD_MUTEX_UNLOCK_PRE() local
2064 thr = map_threads_maybe_lookup( tid ); in evh__HG_PTHREAD_MUTEX_UNLOCK_PRE()
2065 tl_assert(thr); /* cannot fail - Thread* must already exist */ in evh__HG_PTHREAD_MUTEX_UNLOCK_PRE()
2067 evhH__pre_thread_releases_lock( thr, (Addr)mutex, False/*!isRDWR*/ ); in evh__HG_PTHREAD_MUTEX_UNLOCK_PRE()
2073 Thread* thr; in evh__HG_PTHREAD_MUTEX_UNLOCK_POST() local
2077 thr = map_threads_maybe_lookup( tid ); in evh__HG_PTHREAD_MUTEX_UNLOCK_POST()
2078 tl_assert(thr); /* cannot fail - Thread* must already exist */ in evh__HG_PTHREAD_MUTEX_UNLOCK_POST()
2094 Thread* thr; in evh__HG_PTHREAD_SPIN_INIT_OR_UNLOCK_PRE() local
2105 thr = map_threads_maybe_lookup( tid ); in evh__HG_PTHREAD_SPIN_INIT_OR_UNLOCK_PRE()
2107 tl_assert( HG_(is_sane_Thread)(thr) ); in evh__HG_PTHREAD_SPIN_INIT_OR_UNLOCK_PRE()
2114 evhH__pre_thread_releases_lock( thr, (Addr)slock, in evh__HG_PTHREAD_SPIN_INIT_OR_UNLOCK_PRE()
2225 Thread* thr; in map_cond_to_CVInfo_delete() local
2228 thr = map_threads_maybe_lookup( tid ); in map_cond_to_CVInfo_delete()
2229 tl_assert(thr); /* cannot fail - Thread* must already exist */ in map_cond_to_CVInfo_delete()
2239 thr, "pthread_cond_destroy:" in map_cond_to_CVInfo_delete()
2257 thr, "pthread_cond_destroy: destruction of unknown cond var"); in map_cond_to_CVInfo_delete()
2270 Thread* thr; in evh__HG_PTHREAD_COND_SIGNAL_PRE() local
2278 thr = map_threads_maybe_lookup( tid ); in evh__HG_PTHREAD_COND_SIGNAL_PRE()
2279 tl_assert(thr); /* cannot fail - Thread* must already exist */ in evh__HG_PTHREAD_COND_SIGNAL_PRE()
2313 HG_(record_error_Misc)(thr, in evh__HG_PTHREAD_COND_SIGNAL_PRE()
2317 HG_(record_error_Misc)(thr, in evh__HG_PTHREAD_COND_SIGNAL_PRE()
2321 if (lk->heldBy != NULL && 0 == VG_(elemBag)(lk->heldBy, (UWord)thr)) { in evh__HG_PTHREAD_COND_SIGNAL_PRE()
2322 HG_(record_error_Misc)(thr, in evh__HG_PTHREAD_COND_SIGNAL_PRE()
2338 libhb_so_send( thr->hbthr, cvi->so, True/*strong_send*/ ); in evh__HG_PTHREAD_COND_SIGNAL_PRE()
2346 Thread* thr; in evh__HG_PTHREAD_COND_WAIT_PRE() local
2356 thr = map_threads_maybe_lookup( tid ); in evh__HG_PTHREAD_COND_WAIT_PRE()
2357 tl_assert(thr); /* cannot fail - Thread* must already exist */ in evh__HG_PTHREAD_COND_WAIT_PRE()
2367 thr, in evh__HG_PTHREAD_COND_WAIT_PRE()
2374 thr, "pthread_cond_{timed}wait called with mutex " in evh__HG_PTHREAD_COND_WAIT_PRE()
2380 thr, "pthread_cond_{timed}wait called with un-held mutex"); in evh__HG_PTHREAD_COND_WAIT_PRE()
2383 && VG_(elemBag)( lk->heldBy, (UWord)thr ) == 0) { in evh__HG_PTHREAD_COND_WAIT_PRE()
2386 thr, "pthread_cond_{timed}wait called with mutex " in evh__HG_PTHREAD_COND_WAIT_PRE()
2402 thr, "pthread_cond_{timed}wait: cond is associated " in evh__HG_PTHREAD_COND_WAIT_PRE()
2417 Thread* thr; in evh__HG_PTHREAD_COND_WAIT_POST() local
2425 thr = map_threads_maybe_lookup( tid ); in evh__HG_PTHREAD_COND_WAIT_POST()
2426 tl_assert(thr); /* cannot fail - Thread* must already exist */ in evh__HG_PTHREAD_COND_WAIT_POST()
2436 HG_(record_error_Misc)(thr, "condition variable has been destroyed while" in evh__HG_PTHREAD_COND_WAIT_POST()
2449 HG_(record_error_Misc)( thr, "Bug in libpthread: pthread_cond_wait " in evh__HG_PTHREAD_COND_WAIT_POST()
2455 libhb_so_recv( thr->hbthr, cvi->so, True/*strong_recv*/ ); in evh__HG_PTHREAD_COND_WAIT_POST()
2510 Thread* thr; in evh__HG_PTHREAD_RWLOCK_DESTROY_PRE() local
2516 thr = map_threads_maybe_lookup( tid ); in evh__HG_PTHREAD_RWLOCK_DESTROY_PRE()
2518 tl_assert( HG_(is_sane_Thread)(thr) ); in evh__HG_PTHREAD_RWLOCK_DESTROY_PRE()
2524 thr, "pthread_rwlock_destroy with invalid argument" ); in evh__HG_PTHREAD_RWLOCK_DESTROY_PRE()
2533 thr, "pthread_rwlock_destroy of a locked mutex" ); in evh__HG_PTHREAD_RWLOCK_DESTROY_PRE()
2561 Thread* thr; in evh__HG_PTHREAD_RWLOCK_LOCK_PRE() local
2569 thr = map_threads_maybe_lookup( tid ); in evh__HG_PTHREAD_RWLOCK_LOCK_PRE()
2570 tl_assert(thr); /* cannot fail - Thread* must already exist */ in evh__HG_PTHREAD_RWLOCK_LOCK_PRE()
2577 thr, "pthread_rwlock_{rd,rw}lock with a " in evh__HG_PTHREAD_RWLOCK_LOCK_PRE()
2586 Thread* thr; in evh__HG_PTHREAD_RWLOCK_LOCK_POST() local
2592 thr = map_threads_maybe_lookup( tid ); in evh__HG_PTHREAD_RWLOCK_LOCK_POST()
2593 tl_assert(thr); /* cannot fail - Thread* must already exist */ in evh__HG_PTHREAD_RWLOCK_LOCK_POST()
2597 thr, in evh__HG_PTHREAD_RWLOCK_LOCK_POST()
2606 Thread* thr; in evh__HG_PTHREAD_RWLOCK_UNLOCK_PRE() local
2611 thr = map_threads_maybe_lookup( tid ); in evh__HG_PTHREAD_RWLOCK_UNLOCK_PRE()
2612 tl_assert(thr); /* cannot fail - Thread* must already exist */ in evh__HG_PTHREAD_RWLOCK_UNLOCK_PRE()
2614 evhH__pre_thread_releases_lock( thr, (Addr)rwl, True/*isRDWR*/ ); in evh__HG_PTHREAD_RWLOCK_UNLOCK_PRE()
2620 Thread* thr; in evh__HG_PTHREAD_RWLOCK_UNLOCK_POST() local
2624 thr = map_threads_maybe_lookup( tid ); in evh__HG_PTHREAD_RWLOCK_UNLOCK_POST()
2625 tl_assert(thr); /* cannot fail - Thread* must already exist */ in evh__HG_PTHREAD_RWLOCK_UNLOCK_POST()
2751 Thread* thr; in evh__HG_POSIX_SEM_INIT_POST() local
2757 thr = map_threads_maybe_lookup( tid ); in evh__HG_POSIX_SEM_INIT_POST()
2758 tl_assert(thr); /* cannot fail - Thread* must already exist */ in evh__HG_POSIX_SEM_INIT_POST()
2772 thr, "sem_init: initial value exceeds 10000; using 10000" ); in evh__HG_POSIX_SEM_INIT_POST()
2779 Thr* hbthr = thr->hbthr; in evh__HG_POSIX_SEM_INIT_POST()
2798 Thread* thr; in evh__HG_POSIX_SEM_POST_PRE() local
2806 thr = map_threads_maybe_lookup( tid ); in evh__HG_POSIX_SEM_POST_PRE()
2807 tl_assert(thr); /* cannot fail - Thread* must already exist */ in evh__HG_POSIX_SEM_POST_PRE()
2811 hbthr = thr->hbthr; in evh__HG_POSIX_SEM_POST_PRE()
2826 Thread* thr; in evh__HG_POSIX_SEM_WAIT_POST() local
2834 thr = map_threads_maybe_lookup( tid ); in evh__HG_POSIX_SEM_WAIT_POST()
2835 tl_assert(thr); /* cannot fail - Thread* must already exist */ in evh__HG_POSIX_SEM_WAIT_POST()
2842 hbthr = thr->hbthr; in evh__HG_POSIX_SEM_WAIT_POST()
2852 thr, "Bug in libpthread: sem_wait succeeded on" in evh__HG_POSIX_SEM_WAIT_POST()
2926 Thread* thr; in evh__HG_PTHREAD_BARRIER_INIT_PRE() local
2934 thr = map_threads_maybe_lookup( tid ); in evh__HG_PTHREAD_BARRIER_INIT_PRE()
2935 tl_assert(thr); /* cannot fail - Thread* must already exist */ in evh__HG_PTHREAD_BARRIER_INIT_PRE()
2939 thr, "pthread_barrier_init: 'count' argument is zero" in evh__HG_PTHREAD_BARRIER_INIT_PRE()
2945 thr, "pthread_barrier_init: invalid 'resizable' argument" in evh__HG_PTHREAD_BARRIER_INIT_PRE()
2954 thr, "pthread_barrier_init: barrier is already initialised" in evh__HG_PTHREAD_BARRIER_INIT_PRE()
2961 thr, "pthread_barrier_init: threads are waiting at barrier" in evh__HG_PTHREAD_BARRIER_INIT_PRE()
2980 Thread* thr; in evh__HG_PTHREAD_BARRIER_DESTROY_PRE() local
2991 thr = map_threads_maybe_lookup( tid ); in evh__HG_PTHREAD_BARRIER_DESTROY_PRE()
2992 tl_assert(thr); /* cannot fail - Thread* must already exist */ in evh__HG_PTHREAD_BARRIER_DESTROY_PRE()
2999 thr, "pthread_barrier_destroy: barrier was never initialised" in evh__HG_PTHREAD_BARRIER_DESTROY_PRE()
3005 thr, "pthread_barrier_destroy: threads are waiting at barrier" in evh__HG_PTHREAD_BARRIER_DESTROY_PRE()
3101 Thread* thr; in evh__HG_PTHREAD_BARRIER_WAIT_PRE() local
3110 thr = map_threads_maybe_lookup( tid ); in evh__HG_PTHREAD_BARRIER_WAIT_PRE()
3111 tl_assert(thr); /* cannot fail - Thread* must already exist */ in evh__HG_PTHREAD_BARRIER_WAIT_PRE()
3118 thr, "pthread_barrier_wait: barrier is uninitialised" in evh__HG_PTHREAD_BARRIER_WAIT_PRE()
3127 VG_(addToXA)( bar->waiting, &thr ); in evh__HG_PTHREAD_BARRIER_WAIT_PRE()
3144 Thread* thr; in evh__HG_PTHREAD_BARRIER_RESIZE_PRE() local
3153 thr = map_threads_maybe_lookup( tid ); in evh__HG_PTHREAD_BARRIER_RESIZE_PRE()
3154 tl_assert(thr); /* cannot fail - Thread* must already exist */ in evh__HG_PTHREAD_BARRIER_RESIZE_PRE()
3161 thr, "pthread_barrier_resize: barrier is uninitialised" in evh__HG_PTHREAD_BARRIER_RESIZE_PRE()
3168 thr, "pthread_barrier_resize: barrier is may not be resized" in evh__HG_PTHREAD_BARRIER_RESIZE_PRE()
3175 thr, "pthread_barrier_resize: 'newcount' argument is zero" in evh__HG_PTHREAD_BARRIER_RESIZE_PRE()
3264 Thread* thr; in evh__HG_USERSO_SEND_PRE() local
3271 thr = map_threads_maybe_lookup( tid ); in evh__HG_USERSO_SEND_PRE()
3272 tl_assert(thr); /* cannot fail - Thread* must already exist */ in evh__HG_USERSO_SEND_PRE()
3277 libhb_so_send( thr->hbthr, so, False/*!strong_send*/ ); in evh__HG_USERSO_SEND_PRE()
3289 Thread* thr; in evh__HG_USERSO_RECV_POST() local
3296 thr = map_threads_maybe_lookup( tid ); in evh__HG_USERSO_RECV_POST()
3297 tl_assert(thr); /* cannot fail - Thread* must already exist */ in evh__HG_USERSO_RECV_POST()
3305 libhb_so_recv( thr->hbthr, so, True/*strong_recv*/ ); in evh__HG_USERSO_RECV_POST()
3766 Thread* thr, /* NB: BEFORE lock is added */ in laog__pre_thread_acquires_lock() argument
3777 if (HG_(elemWS)( univ_lsets, thr->locksetA, (UWord)lk )) in laog__pre_thread_acquires_lock()
3786 other = laog__do_dfs_from_to(lk, thr->locksetA); in laog__pre_thread_acquires_lock()
3809 thr, lk, other, in laog__pre_thread_acquires_lock()
3859 thr, lk, other, in laog__pre_thread_acquires_lock()
3870 HG_(getPayloadWS)( &ls_words, &ls_size, univ_lsets, thr->locksetA ); in laog__pre_thread_acquires_lock()
3987 Thread* thr; /* allocating thread */ member
4033 md->thr = map_threads_lookup( tid ); in handle_alloc()
4183 md_new->thr = map_threads_lookup( tid ); in hg_cli__realloc()
4257 if (tnr) *tnr = mm->thr->errmsg_index; in HG_()
5242 Thread* thr = map_threads_maybe_lookup( tid ); in hg_handle_client_request() local
5243 tl_assert( thr ); /* I must be mapped */ in hg_handle_client_request()
5248 HG_(record_error_Misc)( thr, buf ); in hg_handle_client_request()
5480 Thread* thr; in for_libhb__get_stacktrace() local
5484 thr = libhb_get_Thr_hgthread( hbt ); in for_libhb__get_stacktrace()
5485 tl_assert(thr); in for_libhb__get_stacktrace()
5486 tid = map_threads_maybe_reverse_lookup_SLOW(thr); in for_libhb__get_stacktrace()
5497 Thread* thr; in for_libhb__get_EC() local
5501 thr = libhb_get_Thr_hgthread( hbt ); in for_libhb__get_EC()
5502 tl_assert(thr); in for_libhb__get_EC()
5503 tid = map_threads_maybe_reverse_lookup_SLOW(thr); in for_libhb__get_EC()