Instance Method

lockBeforeDate:

Attempts to acquire a lock before a specified moment in time.

Declaration

- (BOOL)lockBeforeDate:(NSDate *)limit;

Parameters

limit

The date by which the lock must be acquired or the attempt will time out.

Return Value

YES if the lock is acquired within the time limit, NO otherwise.

Discussion

The condition associated with the receiver isn’t taken into account in this operation. This method blocks the thread’s execution until the receiver acquires the lock or limit is reached.

See Also

Acquiring and Releasing a Lock

- lockWhenCondition:

Attempts to acquire a lock.

- lockWhenCondition:beforeDate:

Attempts to acquire a lock before a specified moment in time.

- tryLock

Attempts to acquire a lock without regard to the receiver’s condition.

- tryLockWhenCondition:

Attempts to acquire a lock if the receiver’s condition is equal to the specified condition.

- unlockWithCondition:

Relinquishes the lock and sets the receiver’s condition.