|
From: <sv...@va...> - 2009-05-31 11:53:45
|
Author: bart
Date: 2009-05-31 12:53:39 +0100 (Sun, 31 May 2009)
New Revision: 10177
Log:
Customized for DRD.
Modified:
trunk/drd/tests/tsan_thread_wrappers_pthread.h
trunk/drd/tests/tsan_unittest.cpp
Modified: trunk/drd/tests/tsan_thread_wrappers_pthread.h
===================================================================
--- trunk/drd/tests/tsan_thread_wrappers_pthread.h 2009-05-31 11:22:58 UTC (rev 10176)
+++ trunk/drd/tests/tsan_thread_wrappers_pthread.h 2009-05-31 11:53:39 UTC (rev 10177)
@@ -61,7 +61,10 @@
#include <sys/time.h>
#include <time.h>
-#include "dynamic_annotations.h"
+#include "../../drd/drd.h"
+#define ANNOTATE_NO_OP(arg) do { } while(0)
+#define ANNOTATE_EXPECT_RACE(addr, descr) DRDCL_(ignore_range)(addr, 4)
+static inline bool RunningOnValgrind() { return RUNNING_ON_VALGRIND; }
#include <assert.h>
#ifdef NDEBUG
Modified: trunk/drd/tests/tsan_unittest.cpp
===================================================================
--- trunk/drd/tests/tsan_unittest.cpp 2009-05-31 11:22:58 UTC (rev 10176)
+++ trunk/drd/tests/tsan_unittest.cpp 2009-05-31 11:53:39 UTC (rev 10177)
@@ -46,7 +46,7 @@
// This test must not include any other file specific to threading library,
// everything should be inside THREAD_WRAPPERS.
#ifndef THREAD_WRAPPERS
-# define THREAD_WRAPPERS "thread_wrappers_pthread.h"
+# define THREAD_WRAPPERS "tsan_thread_wrappers_pthread.h"
#endif
#include THREAD_WRAPPERS
@@ -208,7 +208,7 @@
ANNOTATE_EXPECT_RACE_FOR_MACHINE(mem, descr, "MSM_THREAD_SANITIZER")
inline bool Tsan_PureHappensBefore() {
- return getenv("TSAN_PURE_HAPPENS_BEFORE") != NULL;
+ return true;
}
inline bool Tsan_FastMode() {
@@ -1515,7 +1515,7 @@
for (int j = i; j < N; j++) {
GLOB[j] = j;
}
- ANNOTATE_CONDVAR_SIGNAL(reinterpret_cast<void*>(BOUNDARY+1));
+ ANNOTATE_HAPPENS_BEFORE(reinterpret_cast<void*>(BOUNDARY+1));
BOUNDARY++;
usleep(1000);
}
@@ -1526,7 +1526,7 @@
do {
n = BOUNDARY;
if (n == 0) continue;
- ANNOTATE_CONDVAR_WAIT(reinterpret_cast<void*>(n));
+ ANNOTATE_HAPPENS_AFTER_REPEATEDLY(reinterpret_cast<void*>(n));
for (int i = 0; i < n; i++) {
CHECK(GLOB[i] == i);
}
@@ -1568,7 +1568,7 @@
for (int j = i; j < N; j++) {
GLOB[j] = j;
}
- ANNOTATE_CONDVAR_SIGNAL(reinterpret_cast<void*>(BOUNDARY+1));
+ ANNOTATE_HAPPENS_BEFORE(reinterpret_cast<void*>(BOUNDARY+1));
BOUNDARY++;
usleep(1000);
}
@@ -1579,7 +1579,7 @@
do {
n = BOUNDARY;
if (n == 0) continue;
- ANNOTATE_CONDVAR_WAIT(reinterpret_cast<void*>(n));
+ ANNOTATE_HAPPENS_AFTER_REPEATEDLY(reinterpret_cast<void*>(n));
for (int i = 0; i < n; i++) {
if(GLOB[i] == i) {
GLOB[i]++;
|