Skip to content

Commit

Permalink
@inlinable
Browse files Browse the repository at this point in the history
  • Loading branch information
swhitty committed Sep 3, 2024
1 parent 603b0c0 commit 0fa2665
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Sources/AllocatedLock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@

// Backports the Swift interface around os_unfair_lock_t available in recent Darwin platforms
//
@usableFromInline
struct AllocatedLock<State>: @unchecked Sendable {

@usableFromInline
let storage: Storage

@usableFromInline
init(initialState: State) {
self.storage = Storage(initialState: initialState)
}
Expand Down
6 changes: 6 additions & 0 deletions Sources/IdentifiableContinuation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
/// - body: A closure that takes a `IdentifiableContinuation` parameter.
/// - handler: Cancellation closure executed when the current Task is cancelled. Handler is always called _after_ the body closure is compeled.
/// - Returns: The value continuation is resumed with.
@inlinable
public func withIdentifiableContinuation<T>(
isolation: isolated (any Actor)? = #isolation,
function: String = #function,
Expand Down Expand Up @@ -90,6 +91,7 @@ public func withIdentifiableContinuation<T>(
/// - body: A closure that takes a `IdentifiableContinuation` parameter.
/// - handler: Cancellation closure executed when the current Task is cancelled. Handler is always called _after_ the body closure is compeled.
/// - Returns: The value continuation is resumed with.
@inlinable
public func withIdentifiableThrowingContinuation<T>(
isolation: isolated (any Actor)? = #isolation,
function: String = #function,
Expand Down Expand Up @@ -138,6 +140,7 @@ public func withIdentifiableThrowingContinuation<T>(
/// - handler: Cancellation closure executed when the current Task is cancelled. Handler is always called _after_ the body closure is compeled.
/// - Returns: The value continuation is resumed with.
@_unsafeInheritExecutor
@inlinable
public func withIdentifiableContinuation<T>(
isolation: isolated some Actor,
function: String = #function,
Expand Down Expand Up @@ -186,6 +189,7 @@ public func withIdentifiableContinuation<T>(
/// - handler: Cancellation closure executed when the current Task is cancelled. Handler is always called _after_ the body closure is compeled.
/// - Returns: The value continuation is resumed with.
@_unsafeInheritExecutor
@inlinable
public func withIdentifiableThrowingContinuation<T>(
isolation: isolated some Actor,
function: String = #function,
Expand Down Expand Up @@ -225,6 +229,7 @@ public struct IdentifiableContinuation<T, E>: Sendable, Identifiable where E: Er

public final class ID: Hashable, Sendable {

@usableFromInline
init() { }

public func hash(into hasher: inout Hasher) {
Expand All @@ -236,6 +241,7 @@ public struct IdentifiableContinuation<T, E>: Sendable, Identifiable where E: Er
}
}

@usableFromInline
init(id: ID, continuation: CheckedContinuation<T, E>) {
self.id = id
self.continuation = continuation
Expand Down

0 comments on commit 0fa2665

Please sign in to comment.