Skip to content

Commit 2c0b473

Browse files
committed
Add Synchronization module
1 parent 87974a8 commit 2c0b473

20 files changed

+81
-19
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,10 @@ option(SWIFT_ENABLE_EXPERIMENTAL_OBSERVATION
647647
"Enable build of the Swift observation module"
648648
FALSE)
649649

650+
option(SWIFT_ENABLE_SYNCHRONIZATION
651+
"Enable build of the Swift Synchronization module"
652+
FALSE)
653+
650654
option(SWIFT_ENABLE_DISPATCH
651655
"Enable use of libdispatch"
652656
TRUE)
@@ -1222,6 +1226,7 @@ if(SWIFT_BUILD_STDLIB OR SWIFT_BUILD_SDK_OVERLAY)
12221226
message(STATUS "Backtracing Support: ${SWIFT_ENABLE_BACKTRACING}")
12231227
message(STATUS "Unicode Support: ${SWIFT_STDLIB_ENABLE_UNICODE_DATA}")
12241228
message(STATUS "Observation Support: ${SWIFT_ENABLE_EXPERIMENTAL_OBSERVATION}")
1229+
message(STATUS "Synchronization Support: ${SWIFT_ENABLE_SYNCHRONIZATION}")
12251230
message(STATUS "")
12261231
else()
12271232
message(STATUS "Not building Swift standard library, SDK overlays, and runtime")

stdlib/cmake/modules/SwiftSource.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,10 @@ function(_add_target_variant_swift_compile_flags
321321
list(APPEND result "-D" "SWIFT_ENABLE_EXPERIMENTAL_OBSERVATION")
322322
endif()
323323

324+
if(SWIFT_ENABLE_SYNCHRONIZATION)
325+
list(APPEND result "-D" "SWIFT_ENABLE_SYNCHRONIZATION")
326+
endif()
327+
324328
if(SWIFT_STDLIB_OS_VERSIONING)
325329
list(APPEND result "-D" "SWIFT_RUNTIME_OS_VERSIONING")
326330
endif()

stdlib/public/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,10 @@ if(SWIFT_BUILD_STDLIB AND NOT SWIFT_STDLIB_BUILD_ONLY_CORE_MODULES)
245245
if(SWIFT_ENABLE_BACKTRACING)
246246
add_subdirectory(Backtracing)
247247
endif()
248+
249+
if(SWIFT_ENABLE_SYNCHRONIZATION)
250+
add_subdirectory(Synchronization)
251+
endif()
248252
endif()
249253

250254
if(SWIFT_BUILD_REMOTE_MIRROR)

stdlib/public/core/Atomics/Atomic.swift renamed to stdlib/public/Synchronization/Atomic.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
import Builtin
14+
1315
/// An atomic value.
1416
@available(SwiftStdlib 5.11, *)
1517
@_rawLayout(like: Value.AtomicRepresentation)

stdlib/public/core/Atomics/AtomicBool.swift renamed to stdlib/public/Synchronization/AtomicBool.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
import Builtin
14+
1315
//===----------------------------------------------------------------------===//
1416
// Bool AtomicValue conformance
1517
//===----------------------------------------------------------------------===//

stdlib/public/core/Atomics/AtomicIntegers.swift.gyb renamed to stdlib/public/Synchronization/AtomicIntegers.swift.gyb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
import Builtin
14+
1315
% from SwiftAtomics import *
1416

1517
% for (intType, intStorage, builtinInt) in intTypes:

stdlib/public/core/Atomics/AtomicMemoryOrderings.swift renamed to stdlib/public/Synchronization/AtomicMemoryOrderings.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
import Builtin
14+
1315
//===----------------------------------------------------------------------===//
1416
// Load Orderings
1517
//===----------------------------------------------------------------------===//

0 commit comments

Comments
 (0)