acquiring writeLock after readLock
I recently ran into a issue where a method call acquired readLock and then it had to acquire a writeLock. I followed the documented way, which is call unlock() on read lock and then acquire write lock.
Now if a thread made a call to another method where it acquired read lock and then called the above method it still works.
Now this suggests you can aquire write lock after acquiring read lock as long as it is a different method. Is this a wrong assessment ?