Lines Matching refs:heldBy
204 lock->heldBy = NULL; in mk_LockN()
216 if (lk->heldBy) in del_LockN()
217 VG_(deleteBag)( lk->heldBy ); in del_LockN()
251 tl_assert(lk->heldBy == NULL); in lockN_acquire_writer()
256 tl_assert(lk->heldBy != NULL); in lockN_acquire_writer()
263 tl_assert(lk->heldBy == NULL); /* can't w-lock recursively */ in lockN_acquire_writer()
266 lk->heldBy = VG_(newBag)( HG_(zalloc), "hg.lNaw.1", HG_(free) ); in lockN_acquire_writer()
267 VG_(addToBag)( lk->heldBy, (UWord)thr ); in lockN_acquire_writer()
270 if (lk->heldBy == NULL) in lockN_acquire_writer()
275 tl_assert(VG_(sizeUniqueBag(lk->heldBy)) == 1); in lockN_acquire_writer()
277 tl_assert(VG_(elemBag)(lk->heldBy, (UWord)thr) in lockN_acquire_writer()
278 == VG_(sizeTotalBag)(lk->heldBy)); in lockN_acquire_writer()
279 VG_(addToBag)(lk->heldBy, (UWord)thr); in lockN_acquire_writer()
282 tl_assert(lk->heldBy == NULL && !lk->heldW); /* must be unheld */ in lockN_acquire_writer()
297 tl_assert(lk->heldBy == NULL in lockN_acquire_reader()
298 || (lk->heldBy != NULL && !lk->heldW)); in lockN_acquire_reader()
307 tl_assert(lk->heldBy == NULL); in lockN_acquire_reader()
312 tl_assert(lk->heldBy != NULL); in lockN_acquire_reader()
316 if (lk->heldBy) { in lockN_acquire_reader()
317 VG_(addToBag)(lk->heldBy, (UWord)thr); in lockN_acquire_reader()
320 lk->heldBy = VG_(newBag)( HG_(zalloc), "hg.lNar.1", HG_(free) ); in lockN_acquire_reader()
321 VG_(addToBag)( lk->heldBy, (UWord)thr ); in lockN_acquire_reader()
337 tl_assert(lk->heldBy); in lockN_release()
340 b = VG_(delFromBag)(lk->heldBy, (UWord)thr); in lockN_release()
345 if (VG_(isEmptyBag)(lk->heldBy)) { in lockN_release()
346 VG_(deleteBag)(lk->heldBy); in lockN_release()
347 lk->heldBy = NULL; in lockN_release()
357 if (!lk->heldBy) { in remove_Lock_from_locksets_of_all_owning_Threads()
362 VG_(initIterBag)( lk->heldBy ); in remove_Lock_from_locksets_of_all_owning_Threads()
363 while (VG_(nextIterBag)( lk->heldBy, (UWord*)&thr, NULL )) { in remove_Lock_from_locksets_of_all_owning_Threads()
377 VG_(doneIterBag)( lk->heldBy ); in remove_Lock_from_locksets_of_all_owning_Threads()
494 space(d+3); VG_(printf)("heldBy %p", lk->heldBy); in pp_Lock()
496 if (lk->heldBy) { in pp_Lock()
500 VG_(initIterBag)( lk->heldBy ); in pp_Lock()
501 while (VG_(nextIterBag)( lk->heldBy, (UWord*)&thr, &count )) { in pp_Lock()
515 VG_(doneIterBag)( lk->heldBy ); in pp_Lock()
837 if (lk->heldBy) in thread_is_a_holder_of_Lock()
838 return VG_(elemBag)( lk->heldBy, (UWord)thr ) > 0; in thread_is_a_holder_of_Lock()
908 if (lk->heldBy) { in locks__sanity_check()
911 VG_(initIterBag)( lk->heldBy ); in locks__sanity_check()
912 while (VG_(nextIterBag)( lk->heldBy, in locks__sanity_check()
927 VG_(doneIterBag)( lk->heldBy ); in locks__sanity_check()
1082 if (lk->heldBy == NULL) { in evhH__post_thread_w_acquires_lock()
1093 tl_assert(lk->heldBy); in evhH__post_thread_w_acquires_lock()
1103 tl_assert(VG_(sizeUniqueBag)(lk->heldBy) == 1); /* from precondition */ in evhH__post_thread_w_acquires_lock()
1105 if (thr != (Thread*)VG_(anyElementOfBag)(lk->heldBy)) { in evhH__post_thread_w_acquires_lock()
1181 if (lk->heldBy == NULL) { in evhH__post_thread_r_acquires_lock()
1192 tl_assert(lk->heldBy); in evhH__post_thread_r_acquires_lock()
1266 if (!lock->heldBy) { in evhH__pre_thread_releases_lock()
1277 tl_assert(lock->heldBy); in evhH__pre_thread_releases_lock()
1282 n = VG_(elemBag)( lock->heldBy, (UWord)thr ); in evhH__pre_thread_releases_lock()
1289 Thread* realOwner = (Thread*)VG_(anyElementOfBag)( lock->heldBy ); in evhH__pre_thread_releases_lock()
1307 tl_assert(lock->heldBy); in evhH__pre_thread_releases_lock()
1308 tl_assert(n == VG_(elemBag)( lock->heldBy, (UWord)thr )); in evhH__pre_thread_releases_lock()
1322 if (lock->kind == LK_rdwr && lock->heldBy) { in evhH__pre_thread_releases_lock()
1339 tl_assert(!lock->heldBy); in evhH__pre_thread_releases_lock()
1970 if (lk->heldBy) { in evh__HG_PTHREAD_MUTEX_DESTROY_PRE()
1976 VG_(deleteBag)( lk->heldBy ); in evh__HG_PTHREAD_MUTEX_DESTROY_PRE()
1977 lk->heldBy = NULL; in evh__HG_PTHREAD_MUTEX_DESTROY_PRE()
1981 tl_assert( !lk->heldBy ); in evh__HG_PTHREAD_MUTEX_DESTROY_PRE()
2020 && lk->heldBy in evh__HG_PTHREAD_MUTEX_LOCK_PRE()
2022 && VG_(elemBag)( lk->heldBy, (UWord)thr ) > 0 ) { in evh__HG_PTHREAD_MUTEX_LOCK_PRE()
2110 if (lk && lk->heldBy) { in evh__HG_PTHREAD_SPIN_INIT_OR_UNLOCK_PRE()
2316 if (lk->heldBy == NULL) { 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()
2377 if (lk->heldBy == NULL) { in evh__HG_PTHREAD_COND_WAIT_PRE()
2382 if (lk->heldBy != NULL in evh__HG_PTHREAD_COND_WAIT_PRE()
2383 && VG_(elemBag)( lk->heldBy, (UWord)thr ) == 0) { in evh__HG_PTHREAD_COND_WAIT_PRE()
2530 if (lk->heldBy) { in evh__HG_PTHREAD_RWLOCK_DESTROY_PRE()
2536 VG_(deleteBag)( lk->heldBy ); in evh__HG_PTHREAD_RWLOCK_DESTROY_PRE()
2537 lk->heldBy = NULL; in evh__HG_PTHREAD_RWLOCK_DESTROY_PRE()
2541 tl_assert( !lk->heldBy ); in evh__HG_PTHREAD_RWLOCK_DESTROY_PRE()