Wrapped DRD_() macro around even more function names.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9170 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/drd/drd_cond.c b/drd/drd_cond.c
index acb7ee6..b71f676 100644
--- a/drd/drd_cond.c
+++ b/drd/drd_cond.c
@@ -38,35 +38,35 @@
/* Local functions. */
-static void cond_cleanup(struct cond_info* p);
+static void DRD_(cond_cleanup)(struct cond_info* p);
/* Local variables. */
-static Bool s_drd_report_signal_unlocked = True;
-static Bool s_trace_cond;
+static Bool DRD_(s_report_signal_unlocked) = True;
+static Bool DRD_(s_trace_cond);
/* Function definitions. */
-void cond_set_report_signal_unlocked(const Bool r)
+void DRD_(cond_set_report_signal_unlocked)(const Bool r)
{
- s_drd_report_signal_unlocked = r;
+ DRD_(s_report_signal_unlocked) = r;
}
-void cond_set_trace(const Bool trace_cond)
+void DRD_(cond_set_trace)(const Bool trace_cond)
{
- s_trace_cond = trace_cond;
+ DRD_(s_trace_cond) = trace_cond;
}
static
-void cond_initialize(struct cond_info* const p, const Addr cond)
+void DRD_(cond_initialize)(struct cond_info* const p, const Addr cond)
{
tl_assert(cond != 0);
tl_assert(p->a1 == cond);
tl_assert(p->type == ClientCondvar);
- p->cleanup = (void(*)(DrdClientobj*))cond_cleanup;
+ p->cleanup = (void(*)(DrdClientobj*))(DRD_(cond_cleanup));
p->waiter_count = 0;
p->mutex = 0;
}
@@ -75,7 +75,7 @@
* Free the memory that was allocated by cond_initialize(). Called by
* DRD_(clientobj_remove)().
*/
-static void cond_cleanup(struct cond_info* p)
+static void DRD_(cond_cleanup)(struct cond_info* p)
{
tl_assert(p);
if (p->mutex)
@@ -95,7 +95,7 @@
}
}
-static struct cond_info* cond_get_or_allocate(const Addr cond)
+static struct cond_info* DRD_(cond_get_or_allocate)(const Addr cond)
{
struct cond_info *p;
@@ -104,23 +104,23 @@
if (p == 0)
{
p = &(DRD_(clientobj_add)(cond, ClientCondvar)->cond);
- cond_initialize(p, cond);
+ DRD_(cond_initialize)(p, cond);
}
return p;
}
-static struct cond_info* cond_get(const Addr cond)
+static struct cond_info* DRD_(cond_get)(const Addr cond)
{
tl_assert(offsetof(DrdClientobj, cond) == 0);
return &(DRD_(clientobj_get)(cond, ClientCondvar)->cond);
}
/** Called before pthread_cond_init(). */
-void cond_pre_init(const Addr cond)
+void DRD_(cond_pre_init)(const Addr cond)
{
struct cond_info* p;
- if (s_trace_cond)
+ if (DRD_(s_trace_cond))
{
VG_(message)(Vg_UserMsg,
"[%d/%d] cond_init cond 0x%lx",
@@ -129,7 +129,7 @@
cond);
}
- p = cond_get(cond);
+ p = DRD_(cond_get)(cond);
if (p)
{
@@ -141,15 +141,15 @@
&cei);
}
- p = cond_get_or_allocate(cond);
+ p = DRD_(cond_get_or_allocate)(cond);
}
/** Called after pthread_cond_destroy(). */
-void cond_post_destroy(const Addr cond)
+void DRD_(cond_post_destroy)(const Addr cond)
{
struct cond_info* p;
- if (s_trace_cond)
+ if (DRD_(s_trace_cond))
{
VG_(message)(Vg_UserMsg,
"[%d/%d] cond_destroy cond 0x%lx",
@@ -158,7 +158,7 @@
cond);
}
- p = cond_get(cond);
+ p = DRD_(cond_get)(cond);
if (p == 0)
{
CondErrInfo cei = { .cond = cond };
@@ -187,12 +187,12 @@
/** Called before pthread_cond_wait(). Note: before this function is called,
* mutex_unlock() has already been called from drd_clientreq.c.
*/
-int cond_pre_wait(const Addr cond, const Addr mutex)
+int DRD_(cond_pre_wait)(const Addr cond, const Addr mutex)
{
struct cond_info* p;
struct mutex_info* q;
- if (s_trace_cond)
+ if (DRD_(s_trace_cond))
{
VG_(message)(Vg_UserMsg,
"[%d/%d] cond_pre_wait cond 0x%lx",
@@ -201,7 +201,7 @@
cond);
}
- p = cond_get_or_allocate(cond);
+ p = DRD_(cond_get_or_allocate)(cond);
tl_assert(p);
if (p->waiter_count == 0)
@@ -220,8 +220,9 @@
&cwei);
}
tl_assert(p->mutex);
- q = mutex_get(p->mutex);
- if (q && q->owner == DRD_(thread_get_running_tid)() && q->recursion_count > 0)
+ q = DRD_(mutex_get)(p->mutex);
+ if (q
+ && q->owner == DRD_(thread_get_running_tid)() && q->recursion_count > 0)
{
const ThreadId vg_tid = VG_(get_running_tid)();
MutexErrInfo MEI = { q->a1, q->recursion_count, q->owner };
@@ -233,18 +234,18 @@
}
else if (q == 0)
{
- not_a_mutex(p->mutex);
+ DRD_(not_a_mutex)(p->mutex);
}
return ++p->waiter_count;
}
/** Called after pthread_cond_wait(). */
-int cond_post_wait(const Addr cond)
+int DRD_(cond_post_wait)(const Addr cond)
{
struct cond_info* p;
- if (s_trace_cond)
+ if (DRD_(s_trace_cond))
{
VG_(message)(Vg_UserMsg,
"[%d/%d] cond_post_wait cond 0x%lx",
@@ -253,7 +254,7 @@
cond);
}
- p = cond_get(cond);
+ p = DRD_(cond_get)(cond);
if (p)
{
if (p->waiter_count > 0)
@@ -269,16 +270,16 @@
return 0;
}
-static void cond_signal(Addr const cond)
+static void DRD_(cond_signal)(Addr const cond)
{
const ThreadId vg_tid = VG_(get_running_tid)();
const DrdThreadId drd_tid = DRD_(VgThreadIdToDrdThreadId)(vg_tid);
- struct cond_info* const cond_p = cond_get(cond);
+ struct cond_info* const cond_p = DRD_(cond_get)(cond);
if (cond_p && cond_p->waiter_count > 0)
{
- if (s_drd_report_signal_unlocked
- && ! mutex_is_locked_by(cond_p->mutex, drd_tid))
+ if (DRD_(s_report_signal_unlocked)
+ && ! DRD_(mutex_is_locked_by)(cond_p->mutex, drd_tid))
{
/* A signal is sent while the associated mutex has not been locked. */
/* This can indicate but is not necessarily a race condition. */
@@ -300,9 +301,9 @@
}
/** Called before pthread_cond_signal(). */
-void cond_pre_signal(Addr const cond)
+void DRD_(cond_pre_signal)(Addr const cond)
{
- if (s_trace_cond)
+ if (DRD_(s_trace_cond))
{
VG_(message)(Vg_UserMsg,
"[%d/%d] cond_signal cond 0x%lx",
@@ -311,13 +312,13 @@
cond);
}
- cond_signal(cond);
+ DRD_(cond_signal)(cond);
}
/** Called before pthread_cond_broadcast(). */
-void cond_pre_broadcast(Addr const cond)
+void DRD_(cond_pre_broadcast)(Addr const cond)
{
- if (s_trace_cond)
+ if (DRD_(s_trace_cond))
{
VG_(message)(Vg_UserMsg,
"[%d/%d] cond_broadcast cond 0x%lx",
@@ -326,9 +327,9 @@
cond);
}
- cond_signal(cond);
+ DRD_(cond_signal)(cond);
}
/** Called after pthread_cond_destroy(). */
-void cond_thread_delete(const DrdThreadId tid)
+void DRD_(cond_thread_delete)(const DrdThreadId tid)
{ }