Skip to content

Commit

Permalink
Document downgrading and upgrading of ReentrantReadWriteLock
Browse files Browse the repository at this point in the history
  • Loading branch information
pitr-ch committed Jul 6, 2018
1 parent 0e1d60e commit 476f593
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/concurrent/atomic/reentrant_read_write_lock.rb
Expand Up @@ -21,7 +21,9 @@ module Concurrent
# also acquire a read lock OR a write lock more than once. Only when the read (or
# write) lock is released as many times as it was acquired, will the thread
# actually let it go, allowing other threads which might have been waiting
# to proceed.
# to proceed. Therefore the lock can be upgraded by first acquiring
# read lock and then write lock and that the lock can be downgraded by first
# having both read and write lock a releasing just the write lock.
#
# If both read and write locks are acquired by the same thread, it is not strictly
# necessary to release them in the same order they were acquired. In other words,
Expand Down

0 comments on commit 476f593

Please sign in to comment.