Lines Matching refs:heldBy

216    lock->heldBy           = NULL;  in mk_LockN()
228 if (lk->heldBy) in del_LockN()
229 VG_(deleteBag)( lk->heldBy ); in del_LockN()
263 tl_assert(lk->heldBy == NULL); in lockN_acquire_writer()
268 tl_assert(lk->heldBy != NULL); in lockN_acquire_writer()
275 tl_assert(lk->heldBy == NULL); /* can't w-lock recursively */ in lockN_acquire_writer()
278 lk->heldBy = VG_(newBag)( HG_(zalloc), "hg.lNaw.1", HG_(free) ); in lockN_acquire_writer()
279 VG_(addToBag)( lk->heldBy, (UWord)thr ); in lockN_acquire_writer()
282 if (lk->heldBy == NULL) in lockN_acquire_writer()
287 tl_assert(VG_(sizeUniqueBag(lk->heldBy)) == 1); in lockN_acquire_writer()
289 tl_assert(VG_(elemBag)(lk->heldBy, (UWord)thr) in lockN_acquire_writer()
290 == VG_(sizeTotalBag)(lk->heldBy)); in lockN_acquire_writer()
291 VG_(addToBag)(lk->heldBy, (UWord)thr); in lockN_acquire_writer()
294 tl_assert(lk->heldBy == NULL && !lk->heldW); /* must be unheld */ in lockN_acquire_writer()
309 tl_assert(lk->heldBy == NULL in lockN_acquire_reader()
310 || (lk->heldBy != NULL && !lk->heldW)); in lockN_acquire_reader()
319 tl_assert(lk->heldBy == NULL); in lockN_acquire_reader()
324 tl_assert(lk->heldBy != NULL); in lockN_acquire_reader()
328 if (lk->heldBy) { in lockN_acquire_reader()
329 VG_(addToBag)(lk->heldBy, (UWord)thr); in lockN_acquire_reader()
332 lk->heldBy = VG_(newBag)( HG_(zalloc), "hg.lNar.1", HG_(free) ); in lockN_acquire_reader()
333 VG_(addToBag)( lk->heldBy, (UWord)thr ); in lockN_acquire_reader()
349 tl_assert(lk->heldBy); in lockN_release()
352 b = VG_(delFromBag)(lk->heldBy, (UWord)thr); in lockN_release()
357 if (VG_(isEmptyBag)(lk->heldBy)) { in lockN_release()
358 VG_(deleteBag)(lk->heldBy); in lockN_release()
359 lk->heldBy = NULL; in lockN_release()
369 if (!lk->heldBy) { in remove_Lock_from_locksets_of_all_owning_Threads()
374 VG_(initIterBag)( lk->heldBy ); in remove_Lock_from_locksets_of_all_owning_Threads()
375 while (VG_(nextIterBag)( lk->heldBy, (UWord*)&thr, NULL )) { in remove_Lock_from_locksets_of_all_owning_Threads()
389 VG_(doneIterBag)( lk->heldBy ); in remove_Lock_from_locksets_of_all_owning_Threads()
506 space(d+3); VG_(printf)("heldBy %p", lk->heldBy); in pp_Lock()
508 if (lk->heldBy) { in pp_Lock()
512 VG_(initIterBag)( lk->heldBy ); in pp_Lock()
513 while (VG_(nextIterBag)( lk->heldBy, (UWord*)&thr, &count )) { in pp_Lock()
527 VG_(doneIterBag)( lk->heldBy ); in pp_Lock()
877 if (lk->heldBy) in thread_is_a_holder_of_Lock()
878 return VG_(elemBag)( lk->heldBy, (UWord)thr ) > 0; in thread_is_a_holder_of_Lock()
948 if (lk->heldBy) { in locks__sanity_check()
951 VG_(initIterBag)( lk->heldBy ); in locks__sanity_check()
952 while (VG_(nextIterBag)( lk->heldBy, in locks__sanity_check()
967 VG_(doneIterBag)( lk->heldBy ); in locks__sanity_check()
1122 if (lk->heldBy == NULL) { in evhH__post_thread_w_acquires_lock()
1133 tl_assert(lk->heldBy); in evhH__post_thread_w_acquires_lock()
1143 tl_assert(VG_(sizeUniqueBag)(lk->heldBy) == 1); /* from precondition */ in evhH__post_thread_w_acquires_lock()
1145 if (thr != (Thread*)VG_(anyElementOfBag)(lk->heldBy)) { in evhH__post_thread_w_acquires_lock()
1221 if (lk->heldBy == NULL) { in evhH__post_thread_r_acquires_lock()
1232 tl_assert(lk->heldBy); in evhH__post_thread_r_acquires_lock()
1306 if (!lock->heldBy) { in evhH__pre_thread_releases_lock()
1317 tl_assert(lock->heldBy); in evhH__pre_thread_releases_lock()
1322 n = VG_(elemBag)( lock->heldBy, (UWord)thr ); in evhH__pre_thread_releases_lock()
1329 Thread* realOwner = (Thread*)VG_(anyElementOfBag)( lock->heldBy ); in evhH__pre_thread_releases_lock()
1347 tl_assert(lock->heldBy); in evhH__pre_thread_releases_lock()
1348 tl_assert(n == VG_(elemBag)( lock->heldBy, (UWord)thr )); in evhH__pre_thread_releases_lock()
1362 if (lock->kind == LK_rdwr && lock->heldBy) { in evhH__pre_thread_releases_lock()
1379 tl_assert(!lock->heldBy); in evhH__pre_thread_releases_lock()
2048 if (lk->heldBy) { in evh__HG_PTHREAD_MUTEX_DESTROY_PRE()
2054 VG_(deleteBag)( lk->heldBy ); in evh__HG_PTHREAD_MUTEX_DESTROY_PRE()
2055 lk->heldBy = NULL; in evh__HG_PTHREAD_MUTEX_DESTROY_PRE()
2059 tl_assert( !lk->heldBy ); in evh__HG_PTHREAD_MUTEX_DESTROY_PRE()
2098 && lk->heldBy in evh__HG_PTHREAD_MUTEX_LOCK_PRE()
2100 && VG_(elemBag)( lk->heldBy, (UWord)thr ) > 0 ) { in evh__HG_PTHREAD_MUTEX_LOCK_PRE()
2188 if (lk && lk->heldBy) { in evh__HG_PTHREAD_SPIN_INIT_OR_UNLOCK_PRE()
2394 if (lk->heldBy == NULL) { in evh__HG_PTHREAD_COND_SIGNAL_PRE()
2399 if (lk->heldBy != NULL && 0 == VG_(elemBag)(lk->heldBy, (UWord)thr)) { in evh__HG_PTHREAD_COND_SIGNAL_PRE()
2455 if (lk->heldBy == NULL) { in evh__HG_PTHREAD_COND_WAIT_PRE()
2460 if (lk->heldBy != NULL in evh__HG_PTHREAD_COND_WAIT_PRE()
2461 && VG_(elemBag)( lk->heldBy, (UWord)thr ) == 0) { in evh__HG_PTHREAD_COND_WAIT_PRE()
2608 if (lk->heldBy) { in evh__HG_PTHREAD_RWLOCK_DESTROY_PRE()
2614 VG_(deleteBag)( lk->heldBy ); in evh__HG_PTHREAD_RWLOCK_DESTROY_PRE()
2615 lk->heldBy = NULL; in evh__HG_PTHREAD_RWLOCK_DESTROY_PRE()
2619 tl_assert( !lk->heldBy ); in evh__HG_PTHREAD_RWLOCK_DESTROY_PRE()