File tree Expand file tree Collapse file tree 5 files changed +498
-440
lines changed Expand file tree Collapse file tree 5 files changed +498
-440
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,13 @@ void swift_dumpTrackedAccesses();
91
91
92
92
#endif
93
93
94
+ // When building the concurrency library for back deployment, we rename these
95
+ // symbols unformly so they don't conflict with the real concurrency library.
96
+ #ifdef SWIFT_CONCURRENCY_BACK_DEPLOYMENT
97
+ # define swift_task_enterThreadLocalContext swift_task_enterThreadLocalContextBackDeploy
98
+ # define swift_task_exitThreadLocalContext swift_task_exitThreadLocalContextBackDeploy
99
+ #endif
100
+
94
101
// / Called when a task inits, resumes and returns control to caller synchronous
95
102
// / code to update any exclusivity specific state associated with the task.
96
103
// /
Original file line number Diff line number Diff line change
1
+ // ===--- Exclusivity.cpp - Exclusivity tracking ---------------------------===//
2
+ //
3
+ // This source file is part of the Swift.org open source project
4
+ //
5
+ // Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
6
+ // Licensed under Apache License v2.0 with Runtime Library Exception
7
+ //
8
+ // See https://swift.org/LICENSE.txt for license information
9
+ // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10
+ //
11
+ // ===----------------------------------------------------------------------===//
12
+ //
13
+ // This implements the runtime support for dynamically tracking exclusivity.
14
+ //
15
+ // ===----------------------------------------------------------------------===//
16
+ #include < cinttypes>
17
+
18
+ #include " swift/Runtime/Exclusivity.h"
19
+ #include " ../runtime/ExclusivityPrivate.h"
20
+ #include " ../runtime/SwiftTLSContext.h"
21
+
22
+ using namespace swift ;
23
+ using namespace swift ::runtime;
24
+
25
+ // Thread-local storage used by the back-deployed concurrency library.
26
+ namespace {
27
+
28
+ static thread_local SwiftTLSContext TLSContext;
29
+
30
+ } // anonymous namespace
31
+
32
+ SwiftTLSContext &SwiftTLSContext::get () { return TLSContext; }
33
+
34
+ // Bring in the concurrency-specific exclusivity code.
35
+ #include " ../runtime/ConcurrencyExclusivity.inc"
Original file line number Diff line number Diff line change 10
10
#
11
11
#===----------------------------------------------------------------------===#
12
12
13
- set (LLVM_OPTIONAL_SOURCES
14
- ${swift_concurrency_objc_sources} )
13
+ if (NOT swift_concurrency_extra_sources )
14
+ set (swift_concurrency_extra_sources )
15
+ endif ()
15
16
16
17
if (NOT swift_concurrency_install_component )
17
18
set (swift_concurrency_install_component stdlib )
@@ -98,7 +99,7 @@ add_swift_target_library(swift_Concurrency ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} I
98
99
AsyncStream.cpp
99
100
Deque.swift
100
101
YieldingContinuation.swift
101
- ${swift_concurrency_objc_sources }
102
+ ${swift_concurrency_extra_sources }
102
103
103
104
SWIFT_MODULE_DEPENDS_LINUX Glibc
104
105
SWIFT_MODULE_DEPENDS_FREEBSD Glibc
You can’t perform that action at this time.
0 commit comments