Instance Method

lockWhenCondition:

Attempts to acquire a lock.

Declaration

- (void)lockWhenCondition:(NSInteger)condition;

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

- lockBeforeDate:

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

- 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.