*/
#define ANNOTATE_HAPPENS_AFTER(addr) DRDCL_(annotate_happens_after)(addr)
-/**
- * Tell DRD that no more happens-after annotations will follow.
- */
-#define ANNOTATE_HAPPENS_DONE(addr) DRDCL_(annotate_happens_done)(addr)
-
/**
* Tell DRD that waiting on the condition variable at address cv has succeeded
* and a lock on the mutex at address mtx is now held. Since DRD always inserts
VG_USERREQ__DRD_ANNOTATE_HAPPENS_AFTER
= VG_USERREQ_TOOL_BASE('H','G') + 256 + 34,
/* args: Addr. */
- /* Tell DRD to insert a happens-done annotation. */
- VG_USERREQ__DRD_ANNOTATE_HAPPENS_DONE,
- /* args: Addr. */
};
addr, 0, 0, 0, 0);
}
-static __inline__
-void DRDCL_(annotate_happens_done)(const void* const addr)
-{
- int res;
- VALGRIND_DO_CLIENT_REQUEST(res, 0, VG_USERREQ__DRD_ANNOTATE_HAPPENS_DONE,
- addr, 0, 0, 0, 0);
-}
-
static __inline__
void DRDCL_(annotate_rwlock_create)(const void* const rwlock)
{
DRD_(hb_happens_after)(drd_tid, arg[1]);
break;
- case VG_USERREQ__DRD_ANNOTATE_HAPPENS_DONE:
- DRD_(hb_happens_done)(drd_tid, arg[1]);
- break;
-
case VG_USERREQ__DRD_ANNOTATE_RWLOCK_CREATE:
if (arg[1])
{
pthread_cond_init((pthread_cond_t*)&i, NULL);
/* The sequence below is fine. */
- ANNOTATE_HAPPENS_DONE(&i);
+ ANNOTATE_NEW_MEMORY(&i, sizeof(i));
ANNOTATE_HAPPENS_BEFORE(&i);
ANNOTATE_HAPPENS_AFTER(&i);
- ANNOTATE_HAPPENS_DONE(&i);
+ ANNOTATE_NEW_MEMORY(&i, sizeof(i));
ANNOTATE_HAPPENS_BEFORE(&i);
- ANNOTATE_HAPPENS_DONE(&i);
+ ANNOTATE_NEW_MEMORY(&i, sizeof(i));
- /* happens-before after happens-after without intervening happens-done. */
+ /* happens-before after happens-after. */
ANNOTATE_HAPPENS_BEFORE(&i);
ANNOTATE_HAPPENS_AFTER(&i);
ANNOTATE_HAPPENS_BEFORE(&i);
if (--(*m_count_ptr) == 0)
{
if (s_enable_annotations)
- {
ANNOTATE_HAPPENS_AFTER(m_count_ptr);
- ANNOTATE_HAPPENS_DONE(m_count_ptr);
- }
delete m_ptr;
m_ptr = NULL;
delete m_count_ptr;