datarace: simplify raceCheck{Read,Write}() function interfaces
[model-checker.git] / datarace.cc
index 9f75642e27a5a670d30e0c9284e6162cfa8047de..5174c042e177a52773eee7d7668e010ed38a5e54 100644 (file)
@@ -8,10 +8,10 @@
 #include "config.h"
 #include "action.h"
 
-struct ShadowTable *root;
+static struct ShadowTable *root;
 SnapVector<struct DataRace *> unrealizedraces;
-void *memory_base;
-void *memory_top;
+static void *memory_base;
+static void *memory_top;
 
 
 /** This function initialized the data race detector. */
@@ -201,10 +201,11 @@ void fullRaceCheckWrite(thread_id_t thread, void *location, uint64_t *shadow, Cl
 }
 
 /** This function does race detection on a write. */
-void raceCheckWrite(thread_id_t thread, void *location, ClockVector *currClock)
+void raceCheckWrite(thread_id_t thread, void *location)
 {
        uint64_t *shadow = lookupAddressEntry(location);
        uint64_t shadowval = *shadow;
+       ClockVector *currClock = model->get_cv(thread);
 
        /* Do full record */
        if (shadowval != 0 && !ISSHORTRECORD(shadowval)) {
@@ -304,10 +305,11 @@ void fullRaceCheckRead(thread_id_t thread, const void *location, uint64_t *shado
 }
 
 /** This function does race detection on a read. */
-void raceCheckRead(thread_id_t thread, const void *location, ClockVector *currClock)
+void raceCheckRead(thread_id_t thread, const void *location)
 {
        uint64_t *shadow = lookupAddressEntry(location);
        uint64_t shadowval = *shadow;
+       ClockVector *currClock = model->get_cv(thread);
 
        /* Do full record */
        if (shadowval != 0 && !ISSHORTRECORD(shadowval)) {