资 源 简 介
JKeyLockManager
JKeyLockManager (KLM) provides fine-grained locking with application specific keys. All resource and exception handling for the active set of keys is encapsulated in the manager. Thereby it is easier to follow the recommendation of Robert C. Martin: "Keep your concurrency-related code separate from other code."
Abstract
The KLM offers the possibility of performing callbacks within a lock. It selects the lock on the basis of a given key.
...manager.executeLocked("test1", () -> { // run block in lock });
The KLM takes over the maintenance of the locks and keys completely. It can manage arbitrary quantities of keys and locks. One lock is assigned to each key and the necessary locks are produced automatically.
The KLM ensures that unneeded keys and locks are being released quickly.
Behavior with concurrency
请点击左侧文件开始预览 !预览只提供20%的代码片段,完整代码需下载后查看 加载中 侵权举报