mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Build][Runtime] Replace SWIFT_STDLIB_SINGLE_THREADED_RUNTIME.
SWIFT_STDLIB_SINGLE_THREADED_RUNTIME is too much of a blunt instrument here. It covers both the Concurrency runtime and the rest of the runtime, but we'd like to be able to have e.g. a single-threaded Concurrency runtime while the rest of the runtime is still thread safe (for instance). So: rename it to SWIFT_STDLIB_SINGLE_THREADED_CONCURRENCY and make it just control the Concurrency runtime, then add a SWIFT_STDLIB_THREADING_PACKAGE setting at the CMake/build-script level, which defines SWIFT_STDLIB_THREADING_xxx where xxx depends on the chosen threading package. This is especially useful on systems where there may be a choice of threading package that you could use. rdar://90776105
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
using namespace swift;
|
||||
using namespace swift::runtime;
|
||||
|
||||
#ifdef SWIFT_STDLIB_SINGLE_THREADED_RUNTIME
|
||||
#ifdef SWIFT_STDLIB_THREADING_NONE
|
||||
|
||||
SwiftTLSContext &SwiftTLSContext::get() {
|
||||
static SwiftTLSContext TLSContext;
|
||||
@@ -38,7 +38,7 @@ SwiftTLSContext &SwiftTLSContext::get() {
|
||||
SWIFT_ONCE_F(
|
||||
setupToken,
|
||||
[](void *) {
|
||||
pthread_key_init_np(SWIFT_RUNTIME_TLS_KEY, [](void *pointer) {
|
||||
SWIFT_THREAD_KEY_INIT(SWIFT_RUNTIME_TLS_KEY, [](void *pointer) {
|
||||
delete static_cast<SwiftTLSContext *>(pointer);
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user