Contents

lock(whenCondition:)

Attempts to acquire a lock.

Declaration

func lock(whenCondition condition: Int)

Parameters

  • condition:

    The condition to match on.

Discussion

The receiver’s condition must be equal to condition before the locking operation will succeed. This method blocks the thread’s execution until the lock can be acquired.

See Also

Acquiring and Releasing a Lock