diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2016-04-27 12:30:48 +0000 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2016-04-27 12:30:48 +0000 |
| commit | 3efe395788e17f9be556b2570fb0cd9a1ae93796 (patch) | |
| tree | e1e706b5b00c4b4018cd55b67b41a8739f702db8 /compiler-rt/lib/tsan/rtl/tsan_rtl.h | |
| parent | 15cec298e64872b693430214980a822ee2044a5d (diff) | |
| download | bcm5719-llvm-3efe395788e17f9be556b2570fb0cd9a1ae93796.tar.gz bcm5719-llvm-3efe395788e17f9be556b2570fb0cd9a1ae93796.zip | |
tsan: change tsan/Go interface for obtaining the current Processor
Current interface assumes that Go calls ProcWire/ProcUnwire
to establish the association between thread and proc.
With the wisdom of hindsight, this interface does not work
very well. I had to sprinkle Go scheduler with wire/unwire
calls, and any mistake leads to hard to debug crashes.
This is not something one wants to maintian.
Fortunately, there is a simpler solution. We can ask Go
runtime as to what is the current Processor, and that
question is very easy to answer on Go side.
Switch to such interface.
llvm-svn: 267703
Diffstat (limited to 'compiler-rt/lib/tsan/rtl/tsan_rtl.h')
| -rw-r--r-- | compiler-rt/lib/tsan/rtl/tsan_rtl.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler-rt/lib/tsan/rtl/tsan_rtl.h b/compiler-rt/lib/tsan/rtl/tsan_rtl.h index ad3e24ea223..aa8181586cc 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_rtl.h +++ b/compiler-rt/lib/tsan/rtl/tsan_rtl.h @@ -406,7 +406,12 @@ struct ThreadState { DDLogicalThread *dd_lt; // Current wired Processor, or nullptr. Required to handle any events. - Processor *proc; + Processor *proc1; +#ifndef SANITIZER_GO + Processor *proc() { return proc1; } +#else + Processor *proc(); +#endif atomic_uintptr_t in_signal_handler; ThreadSignalContext *signal_ctx; |

