Skip to content

Commit 97072e5

Browse files
committed
Adopt transferring for Mutex init
1 parent ba1787c commit 97072e5

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

stdlib/public/Synchronization/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ set(SWIFT_SYNCHRNOIZATION_SWIFT_FLAGS
7575
"-enable-builtin-module"
7676
"-enable-experimental-feature" "RawLayout"
7777
"-enable-experimental-feature" "StaticExclusiveOnly"
78+
"-enable-experimental-feature" "TransferringArgsAndResults"
7879
)
7980

8081
add_swift_target_library(swiftSynchronization ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB

stdlib/public/Synchronization/Mutex/Mutex.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public struct Mutex<Value: ~Copyable>: ~Copyable {
4747
@available(SwiftStdlib 6.0, *)
4848
@_alwaysEmitIntoClient
4949
@_transparent
50-
public init(_ initialValue: consuming Value) {
50+
public init(_ initialValue: transferring consuming Value) {
5151
value = _Cell(initialValue)
5252
}
5353
}
@@ -120,7 +120,7 @@ extension Mutex where Value: ~Copyable {
120120
/// }
121121
/// return try body(&value)
122122
///
123-
/// - Note: This version of `withLock` is unchecked because it does
123+
/// - Note: This version of `tryWithLock` is unchecked because it does
124124
/// not enforce any sendability guarantees.
125125
///
126126
/// - Warning: Recursive calls to `tryWithLockUnchecked` within the

0 commit comments

Comments
 (0)