Locks Flashcards

1
Q

Acquires the lock

A

void Lock()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Acquires the lock and returns true if the lock is available. If the lock is not available, it does not acquire the lock and returns false. Has an overloaded version that takes a timeout period to wait before returning false.

A

boolean tryLock()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Acquires a lock; if it is interrupted while acquiring the lock, it throws an InterruptedException.

A

void lockInterruptibly()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Returns a Condition object associated with this Lock object.

A

Condition newCondition()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Releases the lock.

A

void unlock()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly