3 ms·
There is no explicit protection for recursive locking. In practice, write locks will deadlock, and read lock under read lock will be fine. However, the API enc
by ot 5y ago
There is no explicit protection for recursive locking. In practice, write locks will deadlock, and read lock under read lock will be fine.
However, the API encourages practices that make it very hard to recursively acquire the lock (Synchronized is about access to objects, not critical sections).