yb12138 commented on PR #4726:
URL: https://github.com/apache/hadoop/pull/4726#issuecomment-1212163886

   @luoyuan3471 
   yes! ReadLock.lock() will call function(tryAcquireShared), this method will 
check whether the waiting queue first node is shared.
   if false, lock method will be blocked even if sharedCount(c) >0.But 
readLock.tryLock() do not need the check, it can get the  csqueue readLock  
directly. 
   you can diff tryReadLock() and Lock(), it's an interesting design.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to