diff options
author | Nathan Harmata <nharmata@google.com> | 2015-04-03 17:11:37 +0000 |
---|---|---|
committer | Kristina Chodorow <kchodorow@google.com> | 2015-04-03 20:37:37 +0000 |
commit | e0e5a4454ba0a3d0886f93080d02465071d5e5fe (patch) | |
tree | 933789aa628407299070f0067dca91515ece21ca /site/404.md | |
parent | 53bd3bf6008a921fda66e59f91d870fe182130b4 (diff) |
Some minor improvements to KeyedLocker:
(i) Change the semantics of KeyedLocker.AutoUnlocker#close such that it can be called at most once per AutoUnlocker instance.
(ii) Change KeyedLocker.AutoUnlocker#close to throw a IllegalUnlockException (RuntimeException) on error, rather than leave the behavior intentionally underspecified.
(iii) explicitly mention in AutoLocker#lock that a thread can call lock(k) multiple times before unlocking. Combined with (i), this implies that KeyedLocker#lock implementations will want to return fresh AutoUnlocker instances.
These semantics are bit nicer to use anyway, but I also want them because I will soon be introducing KeyedLocker#lockBatch, and it's much easier to specify that given the above.
--
MOS_MIGRATED_REVID=90259645
Diffstat (limited to 'site/404.md')
0 files changed, 0 insertions, 0 deletions