File tree 2 files changed +5
-12
lines changed
2 files changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -270,10 +270,10 @@ static SwiftTLSContext &getTLSContext() {
270
270
return *ctx;
271
271
}
272
272
273
- #elif SWIFT_TLS_HAS_THREADLOCAL
273
+ #elif __has_feature(cxx_thread_local)
274
274
// Second choice is direct language support for thread-locals.
275
275
276
- static LLVM_THREAD_LOCAL SwiftTLSContext TLSContext;
276
+ static thread_local SwiftTLSContext TLSContext;
277
277
278
278
static SwiftTLSContext &getTLSContext () {
279
279
return TLSContext;
Original file line number Diff line number Diff line change 26
26
# define SWIFT_TLS_HAS_RESERVED_PTHREAD_SPECIFIC 1
27
27
#endif
28
28
29
- // If we're using Clang, and Clang claims not to support thread_local,
30
- // it must be because we're on a platform that doesn't support it.
31
- #if __clang__ && !__has_feature(cxx_thread_local)
32
- // No thread_local.
33
- #else
34
- // Otherwise, we do have thread_local.
35
- # define SWIFT_TLS_HAS_THREADLOCAL 1
36
- static_assert (LLVM_ENABLE_THREADS, " LLVM_THREAD_LOCAL will use a global?" );
37
- #endif
38
-
39
29
#if SWIFT_TLS_HAS_RESERVED_PTHREAD_SPECIFIC
40
30
// Use reserved TSD keys.
41
31
# if __has_include(<pthread/tsd_private.h>)
@@ -92,6 +82,9 @@ typedef unsigned long __swift_thread_key_t;
92
82
# include < io.h>
93
83
# define WIN32_LEAN_AND_MEAN
94
84
# include < Windows.h>
85
+
86
+ #include < type_traits>
87
+
95
88
static_assert (std::is_same<__swift_thread_key_t , DWORD>::value,
96
89
" __swift_thread_key_t is not a DWORD" );
97
90
You can’t perform that action at this time.
0 commit comments