Lines Matching refs:rwlock

191  * Compare the type of the rwlock specified at initialization time with
199 /* The code below has to be updated if additional rwlock types are added. */
213 ? "Attempt to use a user-defined rwlock as a POSIX rwlock"
214 : "Attempt to use a POSIX rwlock as a user-defined rwlock",
222 void DRD_(rwlock_initialize)(struct rwlock_info* const p, const Addr rwlock,
225 tl_assert(rwlock != 0);
226 tl_assert(p->a1 == rwlock);
234 0, 0, VG_(malloc), "drd.rwlock.ri.1", VG_(free));
256 "Destroying locked rwlock",
272 DRD_(rwlock_get_or_allocate)(const Addr rwlock, const RwLockT rwlock_type)
276 tl_assert(offsetof(DrdClientobj, rwlock) == 0);
277 p = &(DRD_(clientobj_get)(rwlock, ClientRwlock)->rwlock);
284 if (DRD_(clientobj_present)(rwlock, rwlock + 1))
288 .addr = rwlock,
298 p = &(DRD_(clientobj_add)(rwlock, ClientRwlock)->rwlock);
299 DRD_(rwlock_initialize)(p, rwlock, rwlock_type);
303 static struct rwlock_info* DRD_(rwlock_get)(const Addr rwlock)
305 tl_assert(offsetof(DrdClientobj, rwlock) == 0);
306 return &(DRD_(clientobj_get)(rwlock, ClientRwlock)->rwlock);
310 struct rwlock_info* DRD_(rwlock_pre_init)(const Addr rwlock,
317 DRD_(thread_get_running_tid)(), rwlock);
319 p = DRD_(rwlock_get)(rwlock);
336 p = DRD_(rwlock_get_or_allocate)(rwlock, rwlock_type);
342 void DRD_(rwlock_post_destroy)(const Addr rwlock, const RwLockT rwlock_type)
346 p = DRD_(rwlock_get)(rwlock);
351 .addr = rwlock,
363 DRD_(clientobj_remove)(rwlock, ClientRwlock);
372 void DRD_(rwlock_pre_rdlock)(const Addr rwlock, const RwLockT rwlock_type)
378 DRD_(thread_get_running_tid)(), rwlock);
380 p = DRD_(rwlock_get_or_allocate)(rwlock, rwlock_type);
398 void DRD_(rwlock_post_rdlock)(const Addr rwlock, const RwLockT rwlock_type,
406 DRD_(trace_msg)("[%d] post_rwlock_rdlock 0x%lx", drd_tid, rwlock);
408 p = DRD_(rwlock_get)(rwlock);
433 void DRD_(rwlock_pre_wrlock)(const Addr rwlock, const RwLockT rwlock_type)
437 p = DRD_(rwlock_get)(rwlock);
441 DRD_(thread_get_running_tid)(), rwlock);
444 p = DRD_(rwlock_get_or_allocate)(rwlock, rwlock_type);
460 * Update rwlock_info state when locking the pthread_rwlock_t rwlock.
464 void DRD_(rwlock_post_wrlock)(const Addr rwlock, const RwLockT rwlock_type,
471 p = DRD_(rwlock_get)(rwlock);
474 DRD_(trace_msg)("[%d] post_rwlock_wrlock 0x%lx", drd_tid, rwlock);
492 * Update rwlock_info state when unlocking the pthread_rwlock_t rwlock.
494 * @param rwlock Pointer to pthread_rwlock_t data structure in the client space.
496 * @return New value of the rwlock recursion count.
501 void DRD_(rwlock_pre_unlock)(const Addr rwlock, const RwLockT rwlock_type)
509 DRD_(trace_msg)("[%d] rwlock_unlock 0x%lx", drd_tid, rwlock);
511 p = DRD_(rwlock_get)(rwlock);
516 .addr = rwlock,
550 rwlock, p->acquired_at, held, DRD_(s_shared_threshold_ms) };
554 "rwlock",
561 * This pthread_rwlock_unlock() call really unlocks the rwlock. Save
563 * when this rwlock is locked again.
580 rwlock, p->acquired_at, held,
585 "rwlock",
592 * This pthread_rwlock_unlock() call really unlocks the rwlock. Save
594 * when this rwlock is locked again.