]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
drd: Move VG_(getenv)("DRD_VERIFY_CONFLICT_SET")
authorBart Van Assche <bvanassche@acm.org>
Sat, 9 Aug 2014 12:58:17 +0000 (12:58 +0000)
committerBart Van Assche <bvanassche@acm.org>
Sat, 9 Aug 2014 12:58:17 +0000 (12:58 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14249

drd/drd_main.c
drd/drd_thread.c
drd/drd_thread.h

index 1a2060ba435e2634fa382b20c4ccdc47f739af68..10630127a12ca6b18bd213b9de3310dc841d792d 100644 (file)
@@ -44,7 +44,7 @@
 #include "pub_tool_libcassert.h"  // tl_assert()
 #include "pub_tool_libcbase.h"    // VG_(strcmp)
 #include "pub_tool_libcprint.h"   // VG_(printf)
-#include "pub_tool_libcproc.h"
+#include "pub_tool_libcproc.h"    // VG_(getenv)()
 #include "pub_tool_machine.h"
 #include "pub_tool_mallocfree.h"  // VG_(malloc)(), VG_(free)()
 #include "pub_tool_options.h"     // command line options
@@ -883,6 +883,10 @@ void drd_pre_clo_init(void)
       if (smi)
          DRD_(thread_set_segment_merge_interval)(VG_(strtoll10)(smi, NULL));
    }
+
+   if (VG_(getenv)("DRD_VERIFY_CONFLICT_SET"))
+      DRD_(verify_conflict_set) = True;
+
 }
 
 
index 037659ceffd73e1b9e878d5da5b74cf3e6a78e4b..5e53a53f6cd099c6ac709700e11b2a31ab698d03 100644 (file)
@@ -36,7 +36,6 @@
 #include "pub_tool_libcassert.h"  // tl_assert()
 #include "pub_tool_libcbase.h"    // VG_(strlen)()
 #include "pub_tool_libcprint.h"   // VG_(printf)()
-#include "pub_tool_libcproc.h"    // VG_(getenv)()
 #include "pub_tool_machine.h"
 #include "pub_tool_mallocfree.h"  // VG_(malloc)(), VG_(free)()
 #include "pub_tool_options.h"     // VG_(clo_backtrace_size)
@@ -68,7 +67,7 @@ static ThreadId s_vg_running_tid  = VG_INVALID_THREADID;
 DrdThreadId     DRD_(g_drd_running_tid) = DRD_INVALID_THREADID;
 ThreadInfo      DRD_(g_threadinfo)[DRD_N_THREADS];
 struct bitmap*  DRD_(g_conflict_set);
-int DRD_(verify_conflict_set) = -1;
+Bool DRD_(verify_conflict_set);
 static Bool     s_trace_context_switches = False;
 static Bool     s_trace_conflict_set = False;
 static Bool     s_trace_conflict_set_bm = False;
@@ -1354,10 +1353,7 @@ static Bool thread_conflict_set_up_to_date(const DrdThreadId tid)
    Bool result;
    struct bitmap* computed_conflict_set = 0;
 
-   if (DRD_(verify_conflict_set) < 0)
-      DRD_(verify_conflict_set) = VG_(getenv)("DRD_VERIFY_CONFLICT_SET") != 0;
-
-   if (DRD_(verify_conflict_set) == 0)
+   if (!DRD_(verify_conflict_set))
       return True;
 
    thread_compute_conflict_set(&computed_conflict_set, tid);
index 690133bcf03fb03b654ee3882cc8c35fe60e3abe..d4899653a9e820a6651abacae776811093119b1f 100644 (file)
@@ -116,7 +116,7 @@ extern DrdThreadId    DRD_(g_drd_running_tid);
 extern ThreadInfo     DRD_(g_threadinfo)[DRD_N_THREADS];
 /** Conflict set for the currently running thread. */
 extern struct bitmap* DRD_(g_conflict_set);
-extern int            DRD_(verify_conflict_set);
+extern Bool           DRD_(verify_conflict_set);
 
 
 /* Function declarations. */