void (*delete_thread)(union drd_clientobj*, DrdThreadId);
ExeContext* first_observed_at;
OSet* oset; // Per-thread order annotation information.
- Bool done; // Whether happens-done has already been invoked.
};
struct semaphore_info
p->delete_thread = 0;
p->oset = VG_(OSetGen_Create)(0, 0, VG_(malloc), "drd.hb",
VG_(free));
- p->done = False;
}
/**
if (!p)
return;
- if (p->done)
- {
- GenericErrInfo gei = {
- .tid = DRD_(thread_get_running_tid)(),
- .addr = hb,
- };
- VG_(maybe_record_error)(VG_(get_running_tid)(),
- GenericErr,
- VG_(get_IP)(VG_(get_running_tid)()),
- "happens-before after happens-after",
- &gei);
- return;
- }
-
/* Allocate the per-thread data structure if necessary. */
q = VG_(OSetGen_Lookup)(p->oset, &word_tid);
if (!q)
struct hb_thread_info* q;
VectorClock old_vc;
- p = DRD_(hb_get)(hb);
+ p = DRD_(hb_get_or_allocate)(hb);
if (DRD_(s_trace_hb))
{
}
if (!p)
- {
- GenericErrInfo gei = {
- .tid = DRD_(thread_get_running_tid)(),
- .addr = hb,
- };
- VG_(maybe_record_error)(VG_(get_running_tid)(),
- GenericErr,
- VG_(get_IP)(VG_(get_running_tid)()),
- "missing happens-before annotation",
- &gei);
return;
- }
-
- p->done = True;
DRD_(thread_new_segment)(tid);
-missing happens-before annotation
- at 0x........: vgDrdCl_annotate_happens_after (drd.h:?)
- by 0x........: main (annotate_hb_err.c:?)
-
wrong type of synchronization object
at 0x........: vgDrdCl_annotate_happens_before (drd.h:?)
by 0x........: main (annotate_hb_err.c:?)
at 0x........: pthread_cond_init (drd_pthread_intercepts.c:?)
by 0x........: main (annotate_hb_err.c:?)
order annotation 0x........ was first observed at:
- at 0x........: vgDrdCl_annotate_happens_before (drd.h:?)
- by 0x........: main (annotate_hb_err.c:?)
-
-happens-before after happens-after
- at 0x........: vgDrdCl_annotate_happens_before (drd.h:?)
- by 0x........: main (annotate_hb_err.c:?)
-order annotation 0x........ was first observed at:
- at 0x........: vgDrdCl_annotate_happens_before (drd.h:?)
+ at 0x........: vgDrdCl_annotate_happens_after (drd.h:?)
by 0x........: main (annotate_hb_err.c:?)
Done.
-ERROR SUMMARY: 5 errors from 5 contexts (suppressed: 0 from 0)
+ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 0 from 0)