File tree Expand file tree Collapse file tree 1 file changed +6
-13
lines changed
stdlib/public/Concurrency Expand file tree Collapse file tree 1 file changed +6
-13
lines changed Original file line number Diff line number Diff line change 16
16
17
17
#include " TaskPrivate.h"
18
18
19
+ // Thread Sanitizer is not supported on Windows.
19
20
#if defined(_WIN32)
20
- # define NOMINMAX
21
- # include < windows.h >
21
+ void swift::_swift_tsan_acquire ( void *addr) {}
22
+ void swift::_swift_tsan_release ( void *addr) {}
22
23
#else
23
24
#include < dlfcn.h>
24
- #endif
25
25
26
26
namespace {
27
27
using TSanFunc = void (void *);
28
28
TSanFunc *tsan_acquire, *tsan_release;
29
-
30
- TSanFunc *loadSymbol (const char *name) {
31
- #if defined(_WIN32)
32
- return (TSanFunc *)GetProcAddress (GetModuleHandle (NULL ), name);
33
- #else
34
- return (TSanFunc *)dlsym (RTLD_DEFAULT, name);
35
- #endif
36
- }
37
29
} // anonymous namespace
38
30
39
31
void swift::_swift_tsan_acquire (void *addr) {
@@ -50,6 +42,7 @@ void swift::_swift_tsan_release(void *addr) {
50
42
51
43
SWIFT_EXPORT_FROM (swift_Concurrency) SWIFT_CC(c)
52
44
void __tsan_on_initialize() {
53
- tsan_acquire = loadSymbol ( " __tsan_acquire" );
54
- tsan_release = loadSymbol ( " __tsan_release" );
45
+ tsan_acquire = (TSanFunc *) dlsym (RTLD_DEFAULT, " __tsan_acquire" );
46
+ tsan_release = (TSanFunc *) dlsym (RTLD_DEFAULT, " __tsan_release" );
55
47
}
48
+ #endif
You can’t perform that action at this time.
0 commit comments