Skip to content

Commit

Permalink
Mark SafeGlobal as Sendable only if T is Sendable
Browse files Browse the repository at this point in the history
  • Loading branch information
Frizlab committed Mar 7, 2024
1 parent 3bb3047 commit aed1d6c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/SafeGlobal/SafeGlobal.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import Foundation
/* Inspiration from <https://forums.swift.org/t/70116/15>. */


//@propertyWrapper
public final class SafeGlobal<T : Sendable> : @unchecked Sendable {
extension SafeGlobal : @unchecked Sendable where T : Sendable {}
public final class SafeGlobal<T> {

public var wrappedValue: T {
get {safeGlobalLock.withLock{ _wrappedValue }}
Expand Down

0 comments on commit aed1d6c

Please sign in to comment.