p = DRD_(cond_get)(cond);
if (!p)
{
- struct mutex_info* q;
- q = &(DRD_(clientobj_get)(p->mutex, ClientMutex)->mutex);
- {
- CondDestrErrInfo cde = {
- DRD_(thread_get_running_tid)(),
- p->a1,
- q ? q->a1 : 0,
- q ? q->owner : DRD_INVALID_THREADID
- };
- VG_(maybe_record_error)(VG_(get_running_tid)(),
- CondDestrErr,
- VG_(get_IP)(VG_(get_running_tid)()),
- "condition variable has been destroyed while"
- " being waited upon",
- &cde);
- }
+ CondDestrErrInfo cde = {
+ DRD_(thread_get_running_tid)(), cond, 0, DRD_INVALID_THREADID
+ };
+ VG_(maybe_record_error)(VG_(get_running_tid)(),
+ CondDestrErr,
+ VG_(get_IP)(VG_(get_running_tid)()),
+ "condition variable has been destroyed while"
+ " being waited upon",
+ &cde);
return;
}
{
sg = drd_segment_pop(p);
tl_assert(sg);
- if (sg)
+ if (p->last_sem_post_tid != tid
+ && p->last_sem_post_tid != DRD_INVALID_THREADID)
{
- if (p->last_sem_post_tid != tid
- && p->last_sem_post_tid != DRD_INVALID_THREADID)
- {
- DRD_(thread_new_segment_and_combine_vc)(tid, sg);
- }
- else
- DRD_(thread_new_segment)(tid);
- s_semaphore_segment_creation_count++;
- DRD_(sg_put)(sg);
+ DRD_(thread_new_segment_and_combine_vc)(tid, sg);
}
+ else
+ DRD_(thread_new_segment)(tid);
+ s_semaphore_segment_creation_count++;
+ DRD_(sg_put)(sg);
}
}