Semaphore
public class Semaphore
Represents a semaphore object.
Note that named semaphores are shared accross different processes.
-
The maximum length for a semaphore name.
Declaration
Swift
public static var nameMaximumLength: Int -
Whether the semaphore is named.
Note that named semaphores are shared accross different processes.Declaration
Swift
public private( set ) var isNamed: Bool -
The name of the semaphore, if any.
Note that named semaphores are shared accross different processes.Declaration
Swift
public private( set ) var name: String? -
Initializes a semaphore object.
Throws
Semaphore.Erroron failure.Declaration
Swift
public init( count: Int32 = 1, name: String? = nil ) throws -
Locks the semaphore.
Declaration
Swift
public func wait() -
Signals (unlocks) the semaphore.
Declaration
Swift
public func signal() -
Tries to lock the semaphore.
Declaration
Swift
public func tryWait() -> BoolReturn Value
trueif the semaphore was successfully locked, otherwisefalse.
View on GitHub
Semaphore Class Reference