Reputation: 1653
I want to be sure:
read lock:
If a thread is inside a read lock also another thread can enter in this read or in another read lock but any threads can enter in a write lock while 1 or more threads are in inside in a read lock.
write lock:
if a thread is inside in a write lock any threads can enter in a write lock or in a read lock.
Upvotes: 2
Views: 144
Reputation: 1919
Read lock: other threads can also take a read lock, but no thread can hold a write lock.
Write lock: held by at most one thread; no threads can hold a read lock.
So: you can have one of:
Upvotes: 6