Threading
public struct Threading
A wrapper around a variety of threading related functions and classes.
-
Indicates that the call should have no timeout.
Declaration
Swift
public static let noTimeout = 0.0
-
The function type which can be given to
Threading.dispatch
.Declaration
Swift
public typealias ThreadClosure = () -> ()
-
A mutex-type thread lock. The lock can be held by only one thread. Other threads attempting to secure the lock while it is held will block. The lock is initialized as being recursive. The locking thread may lock multiple times, but each lock should be accompanied by an unlock.
See moreDeclaration
Swift
public class Lock
-
A thread event object. Inherits from
See moreThreading.Lock
. The event MUST be locked beforewait
orsignal
is called. While inside thewait
call, the event is automatically placed in the unlocked state. Afterwait
orsignal
return the event will be in the locked state and must be unlocked.Declaration
Swift
public final class Event: Lock
-
A read-write thread lock. Permits multiple readers to hold the while, while only allowing at most one writer to hold the lock. For a writer to acquire the lock all readers must have unlocked. For a reader to acquire the lock no writers must hold the lock.
See moreDeclaration
Swift
public final class RWLock
-
Block the current thread for the indicated time.
Declaration
Swift
public static func sleep(seconds inSeconds: Double)
-
Queue type indicator.
See moreDeclaration
Swift
public enum QueueType
-
Find or create a queue indicated by name and type.
Declaration
Swift
public static func getQueue(name nam: String, type: QueueType) -> ThreadQueue
-
Call the given closure on the
default
concurrent queue Returns immediately.Declaration
Swift
public static func dispatch(closure: Threading.ThreadClosure)