summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cc
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2012-08-16 15:12:35 +0000
committerDmitry Vyukov <dvyukov@google.com>2012-08-16 15:12:35 +0000
commit77196efb1edaa5c614544f10954ba802cbe93d4f (patch)
tree52604b6f62e312956bed145703ca1e9b8f0c7e0a /compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cc
parentcc80cdebb9f3f835283cf70c5b99b8a7fc1ce9bd (diff)
downloadbcm5719-llvm-77196efb1edaa5c614544f10954ba802cbe93d4f.tar.gz
bcm5719-llvm-77196efb1edaa5c614544f10954ba802cbe93d4f.zip
tsan: add flag to disable reporting of destruction of locked mutexes (some programs use that on a regular basis)
llvm-svn: 162024
Diffstat (limited to 'compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cc')
-rw-r--r--compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cc b/compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cc
index 258d203f50b..0f8104313d4 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cc
+++ b/compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cc
@@ -12,6 +12,7 @@
//===----------------------------------------------------------------------===//
#include "tsan_rtl.h"
+#include "tsan_flags.h"
#include "tsan_sync.h"
#include "tsan_report.h"
#include "tsan_symbolize.h"
@@ -43,7 +44,9 @@ void MutexDestroy(ThreadState *thr, uptr pc, uptr addr) {
return;
if (!s->is_linker_init) {
MemoryWrite1Byte(thr, pc, addr);
- if (s->owner_tid != SyncVar::kInvalidTid && !s->is_broken) {
+ if (flags()->report_destroy_locked
+ && s->owner_tid != SyncVar::kInvalidTid
+ && !s->is_broken) {
s->is_broken = true;
ScopedReport rep(ReportTypeMutexDestroyLocked);
rep.AddMutex(s);
OpenPOWER on IntegriCloud