aboutsummaryrefslogtreecommitdiff
path: root/libsanitizer/tsan
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2015-01-13 18:01:30 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2015-01-13 18:01:30 +0100
commitb6a8baccac8de409cd815144d493387e95bd9c8c (patch)
tree9b002e56f585cf7c0a09e33bccf6247735ae68b9 /libsanitizer/tsan
parent41197ad4993d8c6bee52dd6b9d76bdf2c5cc9058 (diff)
sanitizer_deadlock_detector.h: Cherry pick upstream r224518 and r224519.
* sanitizer_common/sanitizer_deadlock_detector.h: Cherry pick upstream r224518 and r224519. * tsan/tsan_rtl_thread.cc: Cherry pick upstream r224702 and r224834. From-SVN: r219545
Diffstat (limited to 'libsanitizer/tsan')
-rw-r--r--libsanitizer/tsan/tsan_rtl_thread.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/libsanitizer/tsan/tsan_rtl_thread.cc b/libsanitizer/tsan/tsan_rtl_thread.cc
index 0c0acc2787f..d75445aa8bb 100644
--- a/libsanitizer/tsan/tsan_rtl_thread.cc
+++ b/libsanitizer/tsan/tsan_rtl_thread.cc
@@ -109,12 +109,13 @@ void ThreadContext::OnStarted(void *arg) {
thr->dd_pt = ctx->dd->CreatePhysicalThread();
thr->dd_lt = ctx->dd->CreateLogicalThread(unique_id);
}
+ thr->fast_state.SetHistorySize(flags()->history_size);
+ // Commit switch to the new part of the trace.
+ // TraceAddEvent will reset stack0/mset0 in the new part for us.
+ TraceAddEvent(thr, thr->fast_state, EventTypeMop, 0);
+
thr->fast_synch_epoch = epoch0;
AcquireImpl(thr, 0, &sync);
- thr->fast_state.SetHistorySize(flags()->history_size);
- const uptr trace = (epoch0 / kTracePartSize) % TraceParts();
- Trace *thr_trace = ThreadTrace(thr->tid);
- thr_trace->headers[trace].epoch0 = epoch0;
StatInc(thr, StatSyncAcquire);
sync.Reset(&thr->clock_cache);
DPrintf("#%d: ThreadStart epoch=%zu stk_addr=%zx stk_size=%zx "