Contents

lock(before:)

Attempts to acquire a lock before a given time and returns a Boolean value indicating whether the attempt was successful.

Declaration

func lock(before limit: Date) -> Bool

Parameters

  • limit:

    The time limit for attempting to acquire a lock.

Return Value

true if the lock is acquired before limit, otherwise false.

Discussion

The thread is blocked until the receiver acquires the lock or limit is reached.

See Also

Related Documentation

  • Threading Programming Guide

Acquiring a Lock