diff --git a/docs/assets/search.js b/docs/assets/search.js index ef0247d..6e71889 100644 --- a/docs/assets/search.js +++ b/docs/assets/search.js @@ -1 +1 @@ -window.searchData = JSON.parse("{\"kinds\":{\"4\":\"Namespace\",\"64\":\"Function\",\"128\":\"Class\",\"256\":\"Interface\",\"512\":\"Constructor\",\"1024\":\"Property\",\"2048\":\"Method\",\"65536\":\"Type literal\",\"262144\":\"Accessor\",\"4194304\":\"Type alias\"},\"rows\":[{\"id\":0,\"kind\":128,\"name\":\"Lock\",\"url\":\"classes/Lock.html\",\"classes\":\"tsd-kind-class\"},{\"id\":1,\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/Lock.html#constructor\",\"classes\":\"tsd-kind-constructor tsd-parent-kind-class\",\"parent\":\"Lock\"},{\"id\":2,\"kind\":1024,\"name\":\"_lock\",\"url\":\"classes/Lock.html#_lock\",\"classes\":\"tsd-kind-property tsd-parent-kind-class tsd-is-protected\",\"parent\":\"Lock\"},{\"id\":3,\"kind\":1024,\"name\":\"_count\",\"url\":\"classes/Lock.html#_count\",\"classes\":\"tsd-kind-property tsd-parent-kind-class tsd-is-protected\",\"parent\":\"Lock\"},{\"id\":4,\"kind\":2048,\"name\":\"lock\",\"url\":\"classes/Lock.html#lock\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"Lock\"},{\"id\":5,\"kind\":262144,\"name\":\"count\",\"url\":\"classes/Lock.html#count\",\"classes\":\"tsd-kind-get-signature tsd-parent-kind-class\",\"parent\":\"Lock\"},{\"id\":6,\"kind\":2048,\"name\":\"isLocked\",\"url\":\"classes/Lock.html#isLocked\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"Lock\"},{\"id\":7,\"kind\":2048,\"name\":\"waitForUnlock\",\"url\":\"classes/Lock.html#waitForUnlock\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"Lock\"},{\"id\":8,\"kind\":2048,\"name\":\"withF\",\"url\":\"classes/Lock.html#withF\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter\",\"parent\":\"Lock\"},{\"id\":9,\"kind\":2048,\"name\":\"withG\",\"url\":\"classes/Lock.html#withG\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter\",\"parent\":\"Lock\"},{\"id\":10,\"kind\":128,\"name\":\"RWLockReader\",\"url\":\"classes/RWLockReader.html\",\"classes\":\"tsd-kind-class\"},{\"id\":11,\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/RWLockReader.html#constructor\",\"classes\":\"tsd-kind-constructor tsd-parent-kind-class\",\"parent\":\"RWLockReader\"},{\"id\":12,\"kind\":1024,\"name\":\"readersLock\",\"url\":\"classes/RWLockReader.html#readersLock\",\"classes\":\"tsd-kind-property tsd-parent-kind-class tsd-is-protected\",\"parent\":\"RWLockReader\"},{\"id\":13,\"kind\":1024,\"name\":\"writersLock\",\"url\":\"classes/RWLockReader.html#writersLock\",\"classes\":\"tsd-kind-property tsd-parent-kind-class tsd-is-protected\",\"parent\":\"RWLockReader\"},{\"id\":14,\"kind\":1024,\"name\":\"writersRelease\",\"url\":\"classes/RWLockReader.html#writersRelease\",\"classes\":\"tsd-kind-property tsd-parent-kind-class tsd-is-protected\",\"parent\":\"RWLockReader\"},{\"id\":15,\"kind\":1024,\"name\":\"readerCountBlocked\",\"url\":\"classes/RWLockReader.html#readerCountBlocked\",\"classes\":\"tsd-kind-property tsd-parent-kind-class tsd-is-protected\",\"parent\":\"RWLockReader\"},{\"id\":16,\"kind\":1024,\"name\":\"_readerCount\",\"url\":\"classes/RWLockReader.html#_readerCount\",\"classes\":\"tsd-kind-property tsd-parent-kind-class tsd-is-protected\",\"parent\":\"RWLockReader\"},{\"id\":17,\"kind\":1024,\"name\":\"_writerCount\",\"url\":\"classes/RWLockReader.html#_writerCount\",\"classes\":\"tsd-kind-property tsd-parent-kind-class tsd-is-protected\",\"parent\":\"RWLockReader\"},{\"id\":18,\"kind\":2048,\"name\":\"lock\",\"url\":\"classes/RWLockReader.html#lock\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"RWLockReader\"},{\"id\":19,\"kind\":2048,\"name\":\"read\",\"url\":\"classes/RWLockReader.html#read\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"RWLockReader\"},{\"id\":20,\"kind\":2048,\"name\":\"write\",\"url\":\"classes/RWLockReader.html#write\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"RWLockReader\"},{\"id\":21,\"kind\":262144,\"name\":\"count\",\"url\":\"classes/RWLockReader.html#count\",\"classes\":\"tsd-kind-get-signature tsd-parent-kind-class\",\"parent\":\"RWLockReader\"},{\"id\":22,\"kind\":262144,\"name\":\"readerCount\",\"url\":\"classes/RWLockReader.html#readerCount\",\"classes\":\"tsd-kind-get-signature tsd-parent-kind-class\",\"parent\":\"RWLockReader\"},{\"id\":23,\"kind\":262144,\"name\":\"writerCount\",\"url\":\"classes/RWLockReader.html#writerCount\",\"classes\":\"tsd-kind-get-signature tsd-parent-kind-class\",\"parent\":\"RWLockReader\"},{\"id\":24,\"kind\":2048,\"name\":\"isLocked\",\"url\":\"classes/RWLockReader.html#isLocked\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"RWLockReader\"},{\"id\":25,\"kind\":2048,\"name\":\"waitForUnlock\",\"url\":\"classes/RWLockReader.html#waitForUnlock\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"RWLockReader\"},{\"id\":26,\"kind\":2048,\"name\":\"withF\",\"url\":\"classes/RWLockReader.html#withF\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter\",\"parent\":\"RWLockReader\"},{\"id\":27,\"kind\":2048,\"name\":\"withReadF\",\"url\":\"classes/RWLockReader.html#withReadF\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter\",\"parent\":\"RWLockReader\"},{\"id\":28,\"kind\":2048,\"name\":\"withWriteF\",\"url\":\"classes/RWLockReader.html#withWriteF\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter\",\"parent\":\"RWLockReader\"},{\"id\":29,\"kind\":2048,\"name\":\"withG\",\"url\":\"classes/RWLockReader.html#withG\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter\",\"parent\":\"RWLockReader\"},{\"id\":30,\"kind\":2048,\"name\":\"withReadG\",\"url\":\"classes/RWLockReader.html#withReadG\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter\",\"parent\":\"RWLockReader\"},{\"id\":31,\"kind\":2048,\"name\":\"withWriteG\",\"url\":\"classes/RWLockReader.html#withWriteG\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter\",\"parent\":\"RWLockReader\"},{\"id\":32,\"kind\":128,\"name\":\"RWLockWriter\",\"url\":\"classes/RWLockWriter.html\",\"classes\":\"tsd-kind-class\"},{\"id\":33,\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/RWLockWriter.html#constructor\",\"classes\":\"tsd-kind-constructor tsd-parent-kind-class\",\"parent\":\"RWLockWriter\"},{\"id\":34,\"kind\":1024,\"name\":\"readersLock\",\"url\":\"classes/RWLockWriter.html#readersLock\",\"classes\":\"tsd-kind-property tsd-parent-kind-class tsd-is-protected\",\"parent\":\"RWLockWriter\"},{\"id\":35,\"kind\":1024,\"name\":\"writersLock\",\"url\":\"classes/RWLockWriter.html#writersLock\",\"classes\":\"tsd-kind-property tsd-parent-kind-class tsd-is-protected\",\"parent\":\"RWLockWriter\"},{\"id\":36,\"kind\":1024,\"name\":\"readersRelease\",\"url\":\"classes/RWLockWriter.html#readersRelease\",\"classes\":\"tsd-kind-property tsd-parent-kind-class tsd-is-protected\",\"parent\":\"RWLockWriter\"},{\"id\":37,\"kind\":1024,\"name\":\"readerCountBlocked\",\"url\":\"classes/RWLockWriter.html#readerCountBlocked\",\"classes\":\"tsd-kind-property tsd-parent-kind-class tsd-is-protected\",\"parent\":\"RWLockWriter\"},{\"id\":38,\"kind\":1024,\"name\":\"_readerCount\",\"url\":\"classes/RWLockWriter.html#_readerCount\",\"classes\":\"tsd-kind-property tsd-parent-kind-class tsd-is-protected\",\"parent\":\"RWLockWriter\"},{\"id\":39,\"kind\":1024,\"name\":\"_writerCount\",\"url\":\"classes/RWLockWriter.html#_writerCount\",\"classes\":\"tsd-kind-property tsd-parent-kind-class tsd-is-protected\",\"parent\":\"RWLockWriter\"},{\"id\":40,\"kind\":2048,\"name\":\"lock\",\"url\":\"classes/RWLockWriter.html#lock\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"RWLockWriter\"},{\"id\":41,\"kind\":2048,\"name\":\"read\",\"url\":\"classes/RWLockWriter.html#read\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"RWLockWriter\"},{\"id\":42,\"kind\":2048,\"name\":\"write\",\"url\":\"classes/RWLockWriter.html#write\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"RWLockWriter\"},{\"id\":43,\"kind\":262144,\"name\":\"count\",\"url\":\"classes/RWLockWriter.html#count\",\"classes\":\"tsd-kind-get-signature tsd-parent-kind-class\",\"parent\":\"RWLockWriter\"},{\"id\":44,\"kind\":262144,\"name\":\"readerCount\",\"url\":\"classes/RWLockWriter.html#readerCount\",\"classes\":\"tsd-kind-get-signature tsd-parent-kind-class\",\"parent\":\"RWLockWriter\"},{\"id\":45,\"kind\":262144,\"name\":\"writerCount\",\"url\":\"classes/RWLockWriter.html#writerCount\",\"classes\":\"tsd-kind-get-signature tsd-parent-kind-class\",\"parent\":\"RWLockWriter\"},{\"id\":46,\"kind\":2048,\"name\":\"isLocked\",\"url\":\"classes/RWLockWriter.html#isLocked\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"RWLockWriter\"},{\"id\":47,\"kind\":2048,\"name\":\"waitForUnlock\",\"url\":\"classes/RWLockWriter.html#waitForUnlock\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"RWLockWriter\"},{\"id\":48,\"kind\":2048,\"name\":\"withF\",\"url\":\"classes/RWLockWriter.html#withF\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter\",\"parent\":\"RWLockWriter\"},{\"id\":49,\"kind\":2048,\"name\":\"withReadF\",\"url\":\"classes/RWLockWriter.html#withReadF\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter\",\"parent\":\"RWLockWriter\"},{\"id\":50,\"kind\":2048,\"name\":\"withWriteF\",\"url\":\"classes/RWLockWriter.html#withWriteF\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter\",\"parent\":\"RWLockWriter\"},{\"id\":51,\"kind\":2048,\"name\":\"withG\",\"url\":\"classes/RWLockWriter.html#withG\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter\",\"parent\":\"RWLockWriter\"},{\"id\":52,\"kind\":2048,\"name\":\"withReadG\",\"url\":\"classes/RWLockWriter.html#withReadG\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter\",\"parent\":\"RWLockWriter\"},{\"id\":53,\"kind\":2048,\"name\":\"withWriteG\",\"url\":\"classes/RWLockWriter.html#withWriteG\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter\",\"parent\":\"RWLockWriter\"},{\"id\":54,\"kind\":128,\"name\":\"LockBox\",\"url\":\"classes/LockBox.html\",\"classes\":\"tsd-kind-class tsd-has-type-parameter\"},{\"id\":55,\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/LockBox.html#constructor\",\"classes\":\"tsd-kind-constructor tsd-parent-kind-class tsd-has-type-parameter\",\"parent\":\"LockBox\"},{\"id\":56,\"kind\":1024,\"name\":\"_locks\",\"url\":\"classes/LockBox.html#_locks\",\"classes\":\"tsd-kind-property tsd-parent-kind-class tsd-is-protected\",\"parent\":\"LockBox\"},{\"id\":57,\"kind\":2048,\"name\":\"lock\",\"url\":\"classes/LockBox.html#lock\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"LockBox\"},{\"id\":58,\"kind\":262144,\"name\":\"locks\",\"url\":\"classes/LockBox.html#locks\",\"classes\":\"tsd-kind-get-signature tsd-parent-kind-class\",\"parent\":\"LockBox\"},{\"id\":59,\"kind\":262144,\"name\":\"count\",\"url\":\"classes/LockBox.html#count\",\"classes\":\"tsd-kind-get-signature tsd-parent-kind-class\",\"parent\":\"LockBox\"},{\"id\":60,\"kind\":2048,\"name\":\"isLocked\",\"url\":\"classes/LockBox.html#isLocked\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"LockBox\"},{\"id\":61,\"kind\":2048,\"name\":\"waitForUnlock\",\"url\":\"classes/LockBox.html#waitForUnlock\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"LockBox\"},{\"id\":62,\"kind\":2048,\"name\":\"withF\",\"url\":\"classes/LockBox.html#withF\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter\",\"parent\":\"LockBox\"},{\"id\":63,\"kind\":2048,\"name\":\"withG\",\"url\":\"classes/LockBox.html#withG\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter\",\"parent\":\"LockBox\"},{\"id\":64,\"kind\":4,\"name\":\"utils\",\"url\":\"modules/utils.html\",\"classes\":\"tsd-kind-namespace\"},{\"id\":65,\"kind\":64,\"name\":\"sleep\",\"url\":\"modules/utils.html#sleep\",\"classes\":\"tsd-kind-function tsd-parent-kind-namespace\",\"parent\":\"utils\"},{\"id\":66,\"kind\":64,\"name\":\"yieldMicro\",\"url\":\"modules/utils.html#yieldMicro\",\"classes\":\"tsd-kind-function tsd-parent-kind-namespace\",\"parent\":\"utils\"},{\"id\":67,\"kind\":4,\"name\":\"errors\",\"url\":\"modules/errors.html\",\"classes\":\"tsd-kind-namespace\"},{\"id\":68,\"kind\":128,\"name\":\"ErrorAsyncLocks\",\"url\":\"classes/errors.ErrorAsyncLocks.html\",\"classes\":\"tsd-kind-class tsd-parent-kind-namespace tsd-has-type-parameter\",\"parent\":\"errors\"},{\"id\":69,\"kind\":1024,\"name\":\"description\",\"url\":\"classes/errors.ErrorAsyncLocks.html#description\",\"classes\":\"tsd-kind-property tsd-parent-kind-class tsd-is-overwrite tsd-is-static\",\"parent\":\"errors.ErrorAsyncLocks\"},{\"id\":70,\"kind\":65536,\"name\":\"__type\",\"url\":\"classes/errors.ErrorAsyncLocks.html#__type\",\"classes\":\"tsd-kind-type-literal tsd-parent-kind-class\",\"parent\":\"errors.ErrorAsyncLocks\"},{\"id\":71,\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/errors.ErrorAsyncLocks.html#constructor\",\"classes\":\"tsd-kind-constructor tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited\",\"parent\":\"errors.ErrorAsyncLocks\"},{\"id\":72,\"kind\":128,\"name\":\"ErrorAsyncLocksTimeout\",\"url\":\"classes/errors.ErrorAsyncLocksTimeout.html\",\"classes\":\"tsd-kind-class tsd-parent-kind-namespace tsd-has-type-parameter\",\"parent\":\"errors\"},{\"id\":73,\"kind\":1024,\"name\":\"description\",\"url\":\"classes/errors.ErrorAsyncLocksTimeout.html#description\",\"classes\":\"tsd-kind-property tsd-parent-kind-class tsd-is-overwrite tsd-is-static\",\"parent\":\"errors.ErrorAsyncLocksTimeout\"},{\"id\":74,\"kind\":65536,\"name\":\"__type\",\"url\":\"classes/errors.ErrorAsyncLocksTimeout.html#__type\",\"classes\":\"tsd-kind-type-literal tsd-parent-kind-class\",\"parent\":\"errors.ErrorAsyncLocksTimeout\"},{\"id\":75,\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/errors.ErrorAsyncLocksTimeout.html#constructor\",\"classes\":\"tsd-kind-constructor tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited\",\"parent\":\"errors.ErrorAsyncLocksTimeout\"},{\"id\":76,\"kind\":128,\"name\":\"ErrorAsyncLocksLockBoxConflict\",\"url\":\"classes/errors.ErrorAsyncLocksLockBoxConflict.html\",\"classes\":\"tsd-kind-class tsd-parent-kind-namespace tsd-has-type-parameter\",\"parent\":\"errors\"},{\"id\":77,\"kind\":1024,\"name\":\"description\",\"url\":\"classes/errors.ErrorAsyncLocksLockBoxConflict.html#description\",\"classes\":\"tsd-kind-property tsd-parent-kind-class tsd-is-overwrite tsd-is-static\",\"parent\":\"errors.ErrorAsyncLocksLockBoxConflict\"},{\"id\":78,\"kind\":65536,\"name\":\"__type\",\"url\":\"classes/errors.ErrorAsyncLocksLockBoxConflict.html#__type\",\"classes\":\"tsd-kind-type-literal tsd-parent-kind-class\",\"parent\":\"errors.ErrorAsyncLocksLockBoxConflict\"},{\"id\":79,\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/errors.ErrorAsyncLocksLockBoxConflict.html#constructor\",\"classes\":\"tsd-kind-constructor tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited\",\"parent\":\"errors.ErrorAsyncLocksLockBoxConflict\"},{\"id\":80,\"kind\":4194304,\"name\":\"POJO\",\"url\":\"modules.html#POJO\",\"classes\":\"tsd-kind-type-alias\"},{\"id\":81,\"kind\":65536,\"name\":\"__type\",\"url\":\"modules.html#POJO.__type\",\"classes\":\"tsd-kind-type-literal tsd-parent-kind-type-alias\",\"parent\":\"POJO\"},{\"id\":82,\"kind\":256,\"name\":\"ToString\",\"url\":\"interfaces/ToString.html\",\"classes\":\"tsd-kind-interface\"},{\"id\":83,\"kind\":2048,\"name\":\"toString\",\"url\":\"interfaces/ToString.html#toString\",\"classes\":\"tsd-kind-method tsd-parent-kind-interface\",\"parent\":\"ToString\"},{\"id\":84,\"kind\":256,\"name\":\"Lockable\",\"url\":\"interfaces/Lockable.html\",\"classes\":\"tsd-kind-interface\"},{\"id\":85,\"kind\":1024,\"name\":\"count\",\"url\":\"interfaces/Lockable.html#count\",\"classes\":\"tsd-kind-property tsd-parent-kind-interface\",\"parent\":\"Lockable\"},{\"id\":86,\"kind\":2048,\"name\":\"lock\",\"url\":\"interfaces/Lockable.html#lock\",\"classes\":\"tsd-kind-method tsd-parent-kind-interface\",\"parent\":\"Lockable\"},{\"id\":87,\"kind\":2048,\"name\":\"isLocked\",\"url\":\"interfaces/Lockable.html#isLocked\",\"classes\":\"tsd-kind-method tsd-parent-kind-interface\",\"parent\":\"Lockable\"},{\"id\":88,\"kind\":2048,\"name\":\"waitForUnlock\",\"url\":\"interfaces/Lockable.html#waitForUnlock\",\"classes\":\"tsd-kind-method tsd-parent-kind-interface\",\"parent\":\"Lockable\"},{\"id\":89,\"kind\":2048,\"name\":\"withF\",\"url\":\"interfaces/Lockable.html#withF\",\"classes\":\"tsd-kind-method tsd-parent-kind-interface tsd-has-type-parameter\",\"parent\":\"Lockable\"},{\"id\":90,\"kind\":2048,\"name\":\"withG\",\"url\":\"interfaces/Lockable.html#withG\",\"classes\":\"tsd-kind-method tsd-parent-kind-interface tsd-has-type-parameter\",\"parent\":\"Lockable\"},{\"id\":91,\"kind\":4194304,\"name\":\"LockRequest\",\"url\":\"modules.html#LockRequest\",\"classes\":\"tsd-kind-type-alias tsd-has-type-parameter\"}],\"index\":{\"version\":\"2.3.9\",\"fields\":[\"name\",\"parent\"],\"fieldVectors\":[[\"name/0\",[0,17.918]],[\"parent/0\",[]],[\"name/1\",[1,25.177]],[\"parent/1\",[0,1.707]],[\"name/2\",[2,41.271]],[\"parent/2\",[0,1.707]],[\"name/3\",[3,41.271]],[\"parent/3\",[0,1.707]],[\"name/4\",[0,17.918]],[\"parent/4\",[0,1.707]],[\"name/5\",[4,28.279]],[\"parent/5\",[0,1.707]],[\"name/6\",[5,28.279]],[\"parent/6\",[0,1.707]],[\"name/7\",[6,28.279]],[\"parent/7\",[0,1.707]],[\"name/8\",[7,28.279]],[\"parent/8\",[0,1.707]],[\"name/9\",[8,28.279]],[\"parent/9\",[0,1.707]],[\"name/10\",[9,14.191]],[\"parent/10\",[]],[\"name/11\",[1,25.177]],[\"parent/11\",[9,1.352]],[\"name/12\",[10,36.163]],[\"parent/12\",[9,1.352]],[\"name/13\",[11,36.163]],[\"parent/13\",[9,1.352]],[\"name/14\",[12,41.271]],[\"parent/14\",[9,1.352]],[\"name/15\",[13,36.163]],[\"parent/15\",[9,1.352]],[\"name/16\",[14,36.163]],[\"parent/16\",[9,1.352]],[\"name/17\",[15,36.163]],[\"parent/17\",[9,1.352]],[\"name/18\",[0,17.918]],[\"parent/18\",[9,1.352]],[\"name/19\",[16,36.163]],[\"parent/19\",[9,1.352]],[\"name/20\",[17,36.163]],[\"parent/20\",[9,1.352]],[\"name/21\",[4,28.279]],[\"parent/21\",[9,1.352]],[\"name/22\",[18,36.163]],[\"parent/22\",[9,1.352]],[\"name/23\",[19,36.163]],[\"parent/23\",[9,1.352]],[\"name/24\",[5,28.279]],[\"parent/24\",[9,1.352]],[\"name/25\",[6,28.279]],[\"parent/25\",[9,1.352]],[\"name/26\",[7,28.279]],[\"parent/26\",[9,1.352]],[\"name/27\",[20,36.163]],[\"parent/27\",[9,1.352]],[\"name/28\",[21,36.163]],[\"parent/28\",[9,1.352]],[\"name/29\",[8,28.279]],[\"parent/29\",[9,1.352]],[\"name/30\",[22,36.163]],[\"parent/30\",[9,1.352]],[\"name/31\",[23,36.163]],[\"parent/31\",[9,1.352]],[\"name/32\",[24,14.191]],[\"parent/32\",[]],[\"name/33\",[1,25.177]],[\"parent/33\",[24,1.352]],[\"name/34\",[10,36.163]],[\"parent/34\",[24,1.352]],[\"name/35\",[11,36.163]],[\"parent/35\",[24,1.352]],[\"name/36\",[25,41.271]],[\"parent/36\",[24,1.352]],[\"name/37\",[13,36.163]],[\"parent/37\",[24,1.352]],[\"name/38\",[14,36.163]],[\"parent/38\",[24,1.352]],[\"name/39\",[15,36.163]],[\"parent/39\",[24,1.352]],[\"name/40\",[0,17.918]],[\"parent/40\",[24,1.352]],[\"name/41\",[16,36.163]],[\"parent/41\",[24,1.352]],[\"name/42\",[17,36.163]],[\"parent/42\",[24,1.352]],[\"name/43\",[4,28.279]],[\"parent/43\",[24,1.352]],[\"name/44\",[18,36.163]],[\"parent/44\",[24,1.352]],[\"name/45\",[19,36.163]],[\"parent/45\",[24,1.352]],[\"name/46\",[5,28.279]],[\"parent/46\",[24,1.352]],[\"name/47\",[6,28.279]],[\"parent/47\",[24,1.352]],[\"name/48\",[7,28.279]],[\"parent/48\",[24,1.352]],[\"name/49\",[20,36.163]],[\"parent/49\",[24,1.352]],[\"name/50\",[21,36.163]],[\"parent/50\",[24,1.352]],[\"name/51\",[8,28.279]],[\"parent/51\",[24,1.352]],[\"name/52\",[22,36.163]],[\"parent/52\",[24,1.352]],[\"name/53\",[23,36.163]],[\"parent/53\",[24,1.352]],[\"name/54\",[26,21.812]],[\"parent/54\",[]],[\"name/55\",[1,25.177]],[\"parent/55\",[26,2.078]],[\"name/56\",[27,41.271]],[\"parent/56\",[26,2.078]],[\"name/57\",[0,17.918]],[\"parent/57\",[26,2.078]],[\"name/58\",[28,41.271]],[\"parent/58\",[26,2.078]],[\"name/59\",[4,28.279]],[\"parent/59\",[26,2.078]],[\"name/60\",[5,28.279]],[\"parent/60\",[26,2.078]],[\"name/61\",[6,28.279]],[\"parent/61\",[26,2.078]],[\"name/62\",[7,28.279]],[\"parent/62\",[26,2.078]],[\"name/63\",[8,28.279]],[\"parent/63\",[26,2.078]],[\"name/64\",[29,32.798]],[\"parent/64\",[]],[\"name/65\",[30,41.271]],[\"parent/65\",[29,3.124]],[\"name/66\",[31,41.271]],[\"parent/66\",[29,3.124]],[\"name/67\",[32,30.285]],[\"parent/67\",[]],[\"name/68\",[33,41.271]],[\"parent/68\",[32,2.885]],[\"name/69\",[34,32.798]],[\"parent/69\",[35,3.124]],[\"name/70\",[36,30.285]],[\"parent/70\",[35,3.124]],[\"name/71\",[1,25.177]],[\"parent/71\",[35,3.124]],[\"name/72\",[37,41.271]],[\"parent/72\",[32,2.885]],[\"name/73\",[34,32.798]],[\"parent/73\",[38,3.124]],[\"name/74\",[36,30.285]],[\"parent/74\",[38,3.124]],[\"name/75\",[1,25.177]],[\"parent/75\",[38,3.124]],[\"name/76\",[39,41.271]],[\"parent/76\",[32,2.885]],[\"name/77\",[34,32.798]],[\"parent/77\",[40,3.124]],[\"name/78\",[36,30.285]],[\"parent/78\",[40,3.124]],[\"name/79\",[1,25.177]],[\"parent/79\",[40,3.124]],[\"name/80\",[41,36.163]],[\"parent/80\",[]],[\"name/81\",[36,30.285]],[\"parent/81\",[41,3.444]],[\"name/82\",[42,32.798]],[\"parent/82\",[]],[\"name/83\",[42,32.798]],[\"parent/83\",[42,3.124]],[\"name/84\",[43,25.177]],[\"parent/84\",[]],[\"name/85\",[4,28.279]],[\"parent/85\",[43,2.398]],[\"name/86\",[0,17.918]],[\"parent/86\",[43,2.398]],[\"name/87\",[5,28.279]],[\"parent/87\",[43,2.398]],[\"name/88\",[6,28.279]],[\"parent/88\",[43,2.398]],[\"name/89\",[7,28.279]],[\"parent/89\",[43,2.398]],[\"name/90\",[8,28.279]],[\"parent/90\",[43,2.398]],[\"name/91\",[44,41.271]],[\"parent/91\",[]]],\"invertedIndex\":[[\"__type\",{\"_index\":36,\"name\":{\"70\":{},\"74\":{},\"78\":{},\"81\":{}},\"parent\":{}}],[\"_count\",{\"_index\":3,\"name\":{\"3\":{}},\"parent\":{}}],[\"_lock\",{\"_index\":2,\"name\":{\"2\":{}},\"parent\":{}}],[\"_locks\",{\"_index\":27,\"name\":{\"56\":{}},\"parent\":{}}],[\"_readercount\",{\"_index\":14,\"name\":{\"16\":{},\"38\":{}},\"parent\":{}}],[\"_writercount\",{\"_index\":15,\"name\":{\"17\":{},\"39\":{}},\"parent\":{}}],[\"constructor\",{\"_index\":1,\"name\":{\"1\":{},\"11\":{},\"33\":{},\"55\":{},\"71\":{},\"75\":{},\"79\":{}},\"parent\":{}}],[\"count\",{\"_index\":4,\"name\":{\"5\":{},\"21\":{},\"43\":{},\"59\":{},\"85\":{}},\"parent\":{}}],[\"description\",{\"_index\":34,\"name\":{\"69\":{},\"73\":{},\"77\":{}},\"parent\":{}}],[\"errorasynclocks\",{\"_index\":33,\"name\":{\"68\":{}},\"parent\":{}}],[\"errorasynclockslockboxconflict\",{\"_index\":39,\"name\":{\"76\":{}},\"parent\":{}}],[\"errorasynclockstimeout\",{\"_index\":37,\"name\":{\"72\":{}},\"parent\":{}}],[\"errors\",{\"_index\":32,\"name\":{\"67\":{}},\"parent\":{\"68\":{},\"72\":{},\"76\":{}}}],[\"errors.errorasynclocks\",{\"_index\":35,\"name\":{},\"parent\":{\"69\":{},\"70\":{},\"71\":{}}}],[\"errors.errorasynclockslockboxconflict\",{\"_index\":40,\"name\":{},\"parent\":{\"77\":{},\"78\":{},\"79\":{}}}],[\"errors.errorasynclockstimeout\",{\"_index\":38,\"name\":{},\"parent\":{\"73\":{},\"74\":{},\"75\":{}}}],[\"islocked\",{\"_index\":5,\"name\":{\"6\":{},\"24\":{},\"46\":{},\"60\":{},\"87\":{}},\"parent\":{}}],[\"lock\",{\"_index\":0,\"name\":{\"0\":{},\"4\":{},\"18\":{},\"40\":{},\"57\":{},\"86\":{}},\"parent\":{\"1\":{},\"2\":{},\"3\":{},\"4\":{},\"5\":{},\"6\":{},\"7\":{},\"8\":{},\"9\":{}}}],[\"lockable\",{\"_index\":43,\"name\":{\"84\":{}},\"parent\":{\"85\":{},\"86\":{},\"87\":{},\"88\":{},\"89\":{},\"90\":{}}}],[\"lockbox\",{\"_index\":26,\"name\":{\"54\":{}},\"parent\":{\"55\":{},\"56\":{},\"57\":{},\"58\":{},\"59\":{},\"60\":{},\"61\":{},\"62\":{},\"63\":{}}}],[\"lockrequest\",{\"_index\":44,\"name\":{\"91\":{}},\"parent\":{}}],[\"locks\",{\"_index\":28,\"name\":{\"58\":{}},\"parent\":{}}],[\"pojo\",{\"_index\":41,\"name\":{\"80\":{}},\"parent\":{\"81\":{}}}],[\"read\",{\"_index\":16,\"name\":{\"19\":{},\"41\":{}},\"parent\":{}}],[\"readercount\",{\"_index\":18,\"name\":{\"22\":{},\"44\":{}},\"parent\":{}}],[\"readercountblocked\",{\"_index\":13,\"name\":{\"15\":{},\"37\":{}},\"parent\":{}}],[\"readerslock\",{\"_index\":10,\"name\":{\"12\":{},\"34\":{}},\"parent\":{}}],[\"readersrelease\",{\"_index\":25,\"name\":{\"36\":{}},\"parent\":{}}],[\"rwlockreader\",{\"_index\":9,\"name\":{\"10\":{}},\"parent\":{\"11\":{},\"12\":{},\"13\":{},\"14\":{},\"15\":{},\"16\":{},\"17\":{},\"18\":{},\"19\":{},\"20\":{},\"21\":{},\"22\":{},\"23\":{},\"24\":{},\"25\":{},\"26\":{},\"27\":{},\"28\":{},\"29\":{},\"30\":{},\"31\":{}}}],[\"rwlockwriter\",{\"_index\":24,\"name\":{\"32\":{}},\"parent\":{\"33\":{},\"34\":{},\"35\":{},\"36\":{},\"37\":{},\"38\":{},\"39\":{},\"40\":{},\"41\":{},\"42\":{},\"43\":{},\"44\":{},\"45\":{},\"46\":{},\"47\":{},\"48\":{},\"49\":{},\"50\":{},\"51\":{},\"52\":{},\"53\":{}}}],[\"sleep\",{\"_index\":30,\"name\":{\"65\":{}},\"parent\":{}}],[\"tostring\",{\"_index\":42,\"name\":{\"82\":{},\"83\":{}},\"parent\":{\"83\":{}}}],[\"utils\",{\"_index\":29,\"name\":{\"64\":{}},\"parent\":{\"65\":{},\"66\":{}}}],[\"waitforunlock\",{\"_index\":6,\"name\":{\"7\":{},\"25\":{},\"47\":{},\"61\":{},\"88\":{}},\"parent\":{}}],[\"withf\",{\"_index\":7,\"name\":{\"8\":{},\"26\":{},\"48\":{},\"62\":{},\"89\":{}},\"parent\":{}}],[\"withg\",{\"_index\":8,\"name\":{\"9\":{},\"29\":{},\"51\":{},\"63\":{},\"90\":{}},\"parent\":{}}],[\"withreadf\",{\"_index\":20,\"name\":{\"27\":{},\"49\":{}},\"parent\":{}}],[\"withreadg\",{\"_index\":22,\"name\":{\"30\":{},\"52\":{}},\"parent\":{}}],[\"withwritef\",{\"_index\":21,\"name\":{\"28\":{},\"50\":{}},\"parent\":{}}],[\"withwriteg\",{\"_index\":23,\"name\":{\"31\":{},\"53\":{}},\"parent\":{}}],[\"write\",{\"_index\":17,\"name\":{\"20\":{},\"42\":{}},\"parent\":{}}],[\"writercount\",{\"_index\":19,\"name\":{\"23\":{},\"45\":{}},\"parent\":{}}],[\"writerslock\",{\"_index\":11,\"name\":{\"13\":{},\"35\":{}},\"parent\":{}}],[\"writersrelease\",{\"_index\":12,\"name\":{\"14\":{}},\"parent\":{}}],[\"yieldmicro\",{\"_index\":31,\"name\":{\"66\":{}},\"parent\":{}}]],\"pipeline\":[]}}"); \ No newline at end of file +window.searchData = JSON.parse("{\"kinds\":{\"4\":\"Namespace\",\"64\":\"Function\",\"128\":\"Class\",\"256\":\"Interface\",\"512\":\"Constructor\",\"1024\":\"Property\",\"2048\":\"Method\",\"65536\":\"Type literal\",\"262144\":\"Accessor\",\"4194304\":\"Type alias\"},\"rows\":[{\"id\":0,\"kind\":128,\"name\":\"Lock\",\"url\":\"classes/Lock.html\",\"classes\":\"tsd-kind-class\"},{\"id\":1,\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/Lock.html#constructor\",\"classes\":\"tsd-kind-constructor tsd-parent-kind-class\",\"parent\":\"Lock\"},{\"id\":2,\"kind\":1024,\"name\":\"_lock\",\"url\":\"classes/Lock.html#_lock\",\"classes\":\"tsd-kind-property tsd-parent-kind-class tsd-is-protected\",\"parent\":\"Lock\"},{\"id\":3,\"kind\":1024,\"name\":\"_count\",\"url\":\"classes/Lock.html#_count\",\"classes\":\"tsd-kind-property tsd-parent-kind-class tsd-is-protected\",\"parent\":\"Lock\"},{\"id\":4,\"kind\":2048,\"name\":\"lock\",\"url\":\"classes/Lock.html#lock\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"Lock\"},{\"id\":5,\"kind\":262144,\"name\":\"count\",\"url\":\"classes/Lock.html#count\",\"classes\":\"tsd-kind-get-signature tsd-parent-kind-class\",\"parent\":\"Lock\"},{\"id\":6,\"kind\":2048,\"name\":\"isLocked\",\"url\":\"classes/Lock.html#isLocked\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"Lock\"},{\"id\":7,\"kind\":2048,\"name\":\"waitForUnlock\",\"url\":\"classes/Lock.html#waitForUnlock\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"Lock\"},{\"id\":8,\"kind\":2048,\"name\":\"withF\",\"url\":\"classes/Lock.html#withF\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter\",\"parent\":\"Lock\"},{\"id\":9,\"kind\":2048,\"name\":\"withG\",\"url\":\"classes/Lock.html#withG\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter\",\"parent\":\"Lock\"},{\"id\":10,\"kind\":128,\"name\":\"RWLockReader\",\"url\":\"classes/RWLockReader.html\",\"classes\":\"tsd-kind-class\"},{\"id\":11,\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/RWLockReader.html#constructor\",\"classes\":\"tsd-kind-constructor tsd-parent-kind-class\",\"parent\":\"RWLockReader\"},{\"id\":12,\"kind\":1024,\"name\":\"readersLock\",\"url\":\"classes/RWLockReader.html#readersLock\",\"classes\":\"tsd-kind-property tsd-parent-kind-class tsd-is-protected\",\"parent\":\"RWLockReader\"},{\"id\":13,\"kind\":1024,\"name\":\"writersLock\",\"url\":\"classes/RWLockReader.html#writersLock\",\"classes\":\"tsd-kind-property tsd-parent-kind-class tsd-is-protected\",\"parent\":\"RWLockReader\"},{\"id\":14,\"kind\":1024,\"name\":\"writersRelease\",\"url\":\"classes/RWLockReader.html#writersRelease\",\"classes\":\"tsd-kind-property tsd-parent-kind-class tsd-is-protected\",\"parent\":\"RWLockReader\"},{\"id\":15,\"kind\":1024,\"name\":\"readerCountBlocked\",\"url\":\"classes/RWLockReader.html#readerCountBlocked\",\"classes\":\"tsd-kind-property tsd-parent-kind-class tsd-is-protected\",\"parent\":\"RWLockReader\"},{\"id\":16,\"kind\":1024,\"name\":\"_readerCount\",\"url\":\"classes/RWLockReader.html#_readerCount\",\"classes\":\"tsd-kind-property tsd-parent-kind-class tsd-is-protected\",\"parent\":\"RWLockReader\"},{\"id\":17,\"kind\":1024,\"name\":\"_writerCount\",\"url\":\"classes/RWLockReader.html#_writerCount\",\"classes\":\"tsd-kind-property tsd-parent-kind-class tsd-is-protected\",\"parent\":\"RWLockReader\"},{\"id\":18,\"kind\":2048,\"name\":\"lock\",\"url\":\"classes/RWLockReader.html#lock\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"RWLockReader\"},{\"id\":19,\"kind\":2048,\"name\":\"read\",\"url\":\"classes/RWLockReader.html#read\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"RWLockReader\"},{\"id\":20,\"kind\":2048,\"name\":\"write\",\"url\":\"classes/RWLockReader.html#write\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"RWLockReader\"},{\"id\":21,\"kind\":262144,\"name\":\"count\",\"url\":\"classes/RWLockReader.html#count\",\"classes\":\"tsd-kind-get-signature tsd-parent-kind-class\",\"parent\":\"RWLockReader\"},{\"id\":22,\"kind\":262144,\"name\":\"readerCount\",\"url\":\"classes/RWLockReader.html#readerCount\",\"classes\":\"tsd-kind-get-signature tsd-parent-kind-class\",\"parent\":\"RWLockReader\"},{\"id\":23,\"kind\":262144,\"name\":\"writerCount\",\"url\":\"classes/RWLockReader.html#writerCount\",\"classes\":\"tsd-kind-get-signature tsd-parent-kind-class\",\"parent\":\"RWLockReader\"},{\"id\":24,\"kind\":2048,\"name\":\"isLocked\",\"url\":\"classes/RWLockReader.html#isLocked\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"RWLockReader\"},{\"id\":25,\"kind\":2048,\"name\":\"waitForUnlock\",\"url\":\"classes/RWLockReader.html#waitForUnlock\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"RWLockReader\"},{\"id\":26,\"kind\":2048,\"name\":\"withF\",\"url\":\"classes/RWLockReader.html#withF\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter\",\"parent\":\"RWLockReader\"},{\"id\":27,\"kind\":2048,\"name\":\"withReadF\",\"url\":\"classes/RWLockReader.html#withReadF\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter\",\"parent\":\"RWLockReader\"},{\"id\":28,\"kind\":2048,\"name\":\"withWriteF\",\"url\":\"classes/RWLockReader.html#withWriteF\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter\",\"parent\":\"RWLockReader\"},{\"id\":29,\"kind\":2048,\"name\":\"withG\",\"url\":\"classes/RWLockReader.html#withG\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter\",\"parent\":\"RWLockReader\"},{\"id\":30,\"kind\":2048,\"name\":\"withReadG\",\"url\":\"classes/RWLockReader.html#withReadG\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter\",\"parent\":\"RWLockReader\"},{\"id\":31,\"kind\":2048,\"name\":\"withWriteG\",\"url\":\"classes/RWLockReader.html#withWriteG\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter\",\"parent\":\"RWLockReader\"},{\"id\":32,\"kind\":128,\"name\":\"RWLockWriter\",\"url\":\"classes/RWLockWriter.html\",\"classes\":\"tsd-kind-class\"},{\"id\":33,\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/RWLockWriter.html#constructor\",\"classes\":\"tsd-kind-constructor tsd-parent-kind-class\",\"parent\":\"RWLockWriter\"},{\"id\":34,\"kind\":1024,\"name\":\"readersLock\",\"url\":\"classes/RWLockWriter.html#readersLock\",\"classes\":\"tsd-kind-property tsd-parent-kind-class tsd-is-protected\",\"parent\":\"RWLockWriter\"},{\"id\":35,\"kind\":1024,\"name\":\"writersLock\",\"url\":\"classes/RWLockWriter.html#writersLock\",\"classes\":\"tsd-kind-property tsd-parent-kind-class tsd-is-protected\",\"parent\":\"RWLockWriter\"},{\"id\":36,\"kind\":1024,\"name\":\"readersRelease\",\"url\":\"classes/RWLockWriter.html#readersRelease\",\"classes\":\"tsd-kind-property tsd-parent-kind-class tsd-is-protected\",\"parent\":\"RWLockWriter\"},{\"id\":37,\"kind\":1024,\"name\":\"readerCountBlocked\",\"url\":\"classes/RWLockWriter.html#readerCountBlocked\",\"classes\":\"tsd-kind-property tsd-parent-kind-class tsd-is-protected\",\"parent\":\"RWLockWriter\"},{\"id\":38,\"kind\":1024,\"name\":\"_readerCount\",\"url\":\"classes/RWLockWriter.html#_readerCount\",\"classes\":\"tsd-kind-property tsd-parent-kind-class tsd-is-protected\",\"parent\":\"RWLockWriter\"},{\"id\":39,\"kind\":1024,\"name\":\"_writerCount\",\"url\":\"classes/RWLockWriter.html#_writerCount\",\"classes\":\"tsd-kind-property tsd-parent-kind-class tsd-is-protected\",\"parent\":\"RWLockWriter\"},{\"id\":40,\"kind\":2048,\"name\":\"lock\",\"url\":\"classes/RWLockWriter.html#lock\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"RWLockWriter\"},{\"id\":41,\"kind\":2048,\"name\":\"read\",\"url\":\"classes/RWLockWriter.html#read\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"RWLockWriter\"},{\"id\":42,\"kind\":2048,\"name\":\"write\",\"url\":\"classes/RWLockWriter.html#write\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"RWLockWriter\"},{\"id\":43,\"kind\":262144,\"name\":\"count\",\"url\":\"classes/RWLockWriter.html#count\",\"classes\":\"tsd-kind-get-signature tsd-parent-kind-class\",\"parent\":\"RWLockWriter\"},{\"id\":44,\"kind\":262144,\"name\":\"readerCount\",\"url\":\"classes/RWLockWriter.html#readerCount\",\"classes\":\"tsd-kind-get-signature tsd-parent-kind-class\",\"parent\":\"RWLockWriter\"},{\"id\":45,\"kind\":262144,\"name\":\"writerCount\",\"url\":\"classes/RWLockWriter.html#writerCount\",\"classes\":\"tsd-kind-get-signature tsd-parent-kind-class\",\"parent\":\"RWLockWriter\"},{\"id\":46,\"kind\":2048,\"name\":\"isLocked\",\"url\":\"classes/RWLockWriter.html#isLocked\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"RWLockWriter\"},{\"id\":47,\"kind\":2048,\"name\":\"waitForUnlock\",\"url\":\"classes/RWLockWriter.html#waitForUnlock\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"RWLockWriter\"},{\"id\":48,\"kind\":2048,\"name\":\"withF\",\"url\":\"classes/RWLockWriter.html#withF\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter\",\"parent\":\"RWLockWriter\"},{\"id\":49,\"kind\":2048,\"name\":\"withReadF\",\"url\":\"classes/RWLockWriter.html#withReadF\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter\",\"parent\":\"RWLockWriter\"},{\"id\":50,\"kind\":2048,\"name\":\"withWriteF\",\"url\":\"classes/RWLockWriter.html#withWriteF\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter\",\"parent\":\"RWLockWriter\"},{\"id\":51,\"kind\":2048,\"name\":\"withG\",\"url\":\"classes/RWLockWriter.html#withG\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter\",\"parent\":\"RWLockWriter\"},{\"id\":52,\"kind\":2048,\"name\":\"withReadG\",\"url\":\"classes/RWLockWriter.html#withReadG\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter\",\"parent\":\"RWLockWriter\"},{\"id\":53,\"kind\":2048,\"name\":\"withWriteG\",\"url\":\"classes/RWLockWriter.html#withWriteG\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter\",\"parent\":\"RWLockWriter\"},{\"id\":54,\"kind\":128,\"name\":\"LockBox\",\"url\":\"classes/LockBox.html\",\"classes\":\"tsd-kind-class tsd-has-type-parameter\"},{\"id\":55,\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/LockBox.html#constructor\",\"classes\":\"tsd-kind-constructor tsd-parent-kind-class tsd-has-type-parameter\",\"parent\":\"LockBox\"},{\"id\":56,\"kind\":1024,\"name\":\"_locks\",\"url\":\"classes/LockBox.html#_locks\",\"classes\":\"tsd-kind-property tsd-parent-kind-class tsd-is-protected\",\"parent\":\"LockBox\"},{\"id\":57,\"kind\":2048,\"name\":\"lock\",\"url\":\"classes/LockBox.html#lock\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"LockBox\"},{\"id\":58,\"kind\":2048,\"name\":\"lockMulti\",\"url\":\"classes/LockBox.html#lockMulti\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"LockBox\"},{\"id\":59,\"kind\":262144,\"name\":\"locks\",\"url\":\"classes/LockBox.html#locks\",\"classes\":\"tsd-kind-get-signature tsd-parent-kind-class\",\"parent\":\"LockBox\"},{\"id\":60,\"kind\":262144,\"name\":\"count\",\"url\":\"classes/LockBox.html#count\",\"classes\":\"tsd-kind-get-signature tsd-parent-kind-class\",\"parent\":\"LockBox\"},{\"id\":61,\"kind\":2048,\"name\":\"isLocked\",\"url\":\"classes/LockBox.html#isLocked\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"LockBox\"},{\"id\":62,\"kind\":2048,\"name\":\"waitForUnlock\",\"url\":\"classes/LockBox.html#waitForUnlock\",\"classes\":\"tsd-kind-method tsd-parent-kind-class\",\"parent\":\"LockBox\"},{\"id\":63,\"kind\":2048,\"name\":\"withF\",\"url\":\"classes/LockBox.html#withF\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter\",\"parent\":\"LockBox\"},{\"id\":64,\"kind\":2048,\"name\":\"withMultiF\",\"url\":\"classes/LockBox.html#withMultiF\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter\",\"parent\":\"LockBox\"},{\"id\":65,\"kind\":2048,\"name\":\"withG\",\"url\":\"classes/LockBox.html#withG\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter\",\"parent\":\"LockBox\"},{\"id\":66,\"kind\":2048,\"name\":\"withMultiG\",\"url\":\"classes/LockBox.html#withMultiG\",\"classes\":\"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter\",\"parent\":\"LockBox\"},{\"id\":67,\"kind\":4,\"name\":\"utils\",\"url\":\"modules/utils.html\",\"classes\":\"tsd-kind-namespace\"},{\"id\":68,\"kind\":64,\"name\":\"sleep\",\"url\":\"modules/utils.html#sleep\",\"classes\":\"tsd-kind-function tsd-parent-kind-namespace\",\"parent\":\"utils\"},{\"id\":69,\"kind\":64,\"name\":\"yieldMicro\",\"url\":\"modules/utils.html#yieldMicro\",\"classes\":\"tsd-kind-function tsd-parent-kind-namespace\",\"parent\":\"utils\"},{\"id\":70,\"kind\":4,\"name\":\"errors\",\"url\":\"modules/errors.html\",\"classes\":\"tsd-kind-namespace\"},{\"id\":71,\"kind\":128,\"name\":\"ErrorAsyncLocks\",\"url\":\"classes/errors.ErrorAsyncLocks.html\",\"classes\":\"tsd-kind-class tsd-parent-kind-namespace tsd-has-type-parameter\",\"parent\":\"errors\"},{\"id\":72,\"kind\":1024,\"name\":\"description\",\"url\":\"classes/errors.ErrorAsyncLocks.html#description\",\"classes\":\"tsd-kind-property tsd-parent-kind-class tsd-is-overwrite tsd-is-static\",\"parent\":\"errors.ErrorAsyncLocks\"},{\"id\":73,\"kind\":65536,\"name\":\"__type\",\"url\":\"classes/errors.ErrorAsyncLocks.html#__type\",\"classes\":\"tsd-kind-type-literal tsd-parent-kind-class\",\"parent\":\"errors.ErrorAsyncLocks\"},{\"id\":74,\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/errors.ErrorAsyncLocks.html#constructor\",\"classes\":\"tsd-kind-constructor tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited\",\"parent\":\"errors.ErrorAsyncLocks\"},{\"id\":75,\"kind\":128,\"name\":\"ErrorAsyncLocksTimeout\",\"url\":\"classes/errors.ErrorAsyncLocksTimeout.html\",\"classes\":\"tsd-kind-class tsd-parent-kind-namespace tsd-has-type-parameter\",\"parent\":\"errors\"},{\"id\":76,\"kind\":1024,\"name\":\"description\",\"url\":\"classes/errors.ErrorAsyncLocksTimeout.html#description\",\"classes\":\"tsd-kind-property tsd-parent-kind-class tsd-is-overwrite tsd-is-static\",\"parent\":\"errors.ErrorAsyncLocksTimeout\"},{\"id\":77,\"kind\":65536,\"name\":\"__type\",\"url\":\"classes/errors.ErrorAsyncLocksTimeout.html#__type\",\"classes\":\"tsd-kind-type-literal tsd-parent-kind-class\",\"parent\":\"errors.ErrorAsyncLocksTimeout\"},{\"id\":78,\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/errors.ErrorAsyncLocksTimeout.html#constructor\",\"classes\":\"tsd-kind-constructor tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited\",\"parent\":\"errors.ErrorAsyncLocksTimeout\"},{\"id\":79,\"kind\":128,\"name\":\"ErrorAsyncLocksLockBoxConflict\",\"url\":\"classes/errors.ErrorAsyncLocksLockBoxConflict.html\",\"classes\":\"tsd-kind-class tsd-parent-kind-namespace tsd-has-type-parameter\",\"parent\":\"errors\"},{\"id\":80,\"kind\":1024,\"name\":\"description\",\"url\":\"classes/errors.ErrorAsyncLocksLockBoxConflict.html#description\",\"classes\":\"tsd-kind-property tsd-parent-kind-class tsd-is-overwrite tsd-is-static\",\"parent\":\"errors.ErrorAsyncLocksLockBoxConflict\"},{\"id\":81,\"kind\":65536,\"name\":\"__type\",\"url\":\"classes/errors.ErrorAsyncLocksLockBoxConflict.html#__type\",\"classes\":\"tsd-kind-type-literal tsd-parent-kind-class\",\"parent\":\"errors.ErrorAsyncLocksLockBoxConflict\"},{\"id\":82,\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/errors.ErrorAsyncLocksLockBoxConflict.html#constructor\",\"classes\":\"tsd-kind-constructor tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited\",\"parent\":\"errors.ErrorAsyncLocksLockBoxConflict\"},{\"id\":83,\"kind\":4194304,\"name\":\"POJO\",\"url\":\"modules.html#POJO\",\"classes\":\"tsd-kind-type-alias\"},{\"id\":84,\"kind\":65536,\"name\":\"__type\",\"url\":\"modules.html#POJO.__type\",\"classes\":\"tsd-kind-type-literal tsd-parent-kind-type-alias\",\"parent\":\"POJO\"},{\"id\":85,\"kind\":256,\"name\":\"ToString\",\"url\":\"interfaces/ToString.html\",\"classes\":\"tsd-kind-interface\"},{\"id\":86,\"kind\":2048,\"name\":\"toString\",\"url\":\"interfaces/ToString.html#toString\",\"classes\":\"tsd-kind-method tsd-parent-kind-interface\",\"parent\":\"ToString\"},{\"id\":87,\"kind\":256,\"name\":\"Lockable\",\"url\":\"interfaces/Lockable.html\",\"classes\":\"tsd-kind-interface\"},{\"id\":88,\"kind\":1024,\"name\":\"count\",\"url\":\"interfaces/Lockable.html#count\",\"classes\":\"tsd-kind-property tsd-parent-kind-interface\",\"parent\":\"Lockable\"},{\"id\":89,\"kind\":2048,\"name\":\"lock\",\"url\":\"interfaces/Lockable.html#lock\",\"classes\":\"tsd-kind-method tsd-parent-kind-interface\",\"parent\":\"Lockable\"},{\"id\":90,\"kind\":2048,\"name\":\"isLocked\",\"url\":\"interfaces/Lockable.html#isLocked\",\"classes\":\"tsd-kind-method tsd-parent-kind-interface\",\"parent\":\"Lockable\"},{\"id\":91,\"kind\":2048,\"name\":\"waitForUnlock\",\"url\":\"interfaces/Lockable.html#waitForUnlock\",\"classes\":\"tsd-kind-method tsd-parent-kind-interface\",\"parent\":\"Lockable\"},{\"id\":92,\"kind\":2048,\"name\":\"withF\",\"url\":\"interfaces/Lockable.html#withF\",\"classes\":\"tsd-kind-method tsd-parent-kind-interface tsd-has-type-parameter\",\"parent\":\"Lockable\"},{\"id\":93,\"kind\":2048,\"name\":\"withG\",\"url\":\"interfaces/Lockable.html#withG\",\"classes\":\"tsd-kind-method tsd-parent-kind-interface tsd-has-type-parameter\",\"parent\":\"Lockable\"},{\"id\":94,\"kind\":4194304,\"name\":\"MultiLockRequest\",\"url\":\"modules.html#MultiLockRequest\",\"classes\":\"tsd-kind-type-alias tsd-has-type-parameter\"},{\"id\":95,\"kind\":4194304,\"name\":\"MultiLockAcquire\",\"url\":\"modules.html#MultiLockAcquire\",\"classes\":\"tsd-kind-type-alias tsd-has-type-parameter\"},{\"id\":96,\"kind\":4194304,\"name\":\"MultiLockAcquired\",\"url\":\"modules.html#MultiLockAcquired\",\"classes\":\"tsd-kind-type-alias tsd-has-type-parameter\"}],\"index\":{\"version\":\"2.3.9\",\"fields\":[\"name\",\"parent\"],\"fieldVectors\":[[\"name/0\",[0,18.441]],[\"parent/0\",[]],[\"name/1\",[1,25.701]],[\"parent/1\",[0,1.743]],[\"name/2\",[2,41.795]],[\"parent/2\",[0,1.743]],[\"name/3\",[3,41.795]],[\"parent/3\",[0,1.743]],[\"name/4\",[0,18.441]],[\"parent/4\",[0,1.743]],[\"name/5\",[4,28.802]],[\"parent/5\",[0,1.743]],[\"name/6\",[5,28.802]],[\"parent/6\",[0,1.743]],[\"name/7\",[6,28.802]],[\"parent/7\",[0,1.743]],[\"name/8\",[7,28.802]],[\"parent/8\",[0,1.743]],[\"name/9\",[8,28.802]],[\"parent/9\",[0,1.743]],[\"name/10\",[9,14.715]],[\"parent/10\",[]],[\"name/11\",[1,25.701]],[\"parent/11\",[9,1.391]],[\"name/12\",[10,36.687]],[\"parent/12\",[9,1.391]],[\"name/13\",[11,36.687]],[\"parent/13\",[9,1.391]],[\"name/14\",[12,41.795]],[\"parent/14\",[9,1.391]],[\"name/15\",[13,36.687]],[\"parent/15\",[9,1.391]],[\"name/16\",[14,36.687]],[\"parent/16\",[9,1.391]],[\"name/17\",[15,36.687]],[\"parent/17\",[9,1.391]],[\"name/18\",[0,18.441]],[\"parent/18\",[9,1.391]],[\"name/19\",[16,36.687]],[\"parent/19\",[9,1.391]],[\"name/20\",[17,36.687]],[\"parent/20\",[9,1.391]],[\"name/21\",[4,28.802]],[\"parent/21\",[9,1.391]],[\"name/22\",[18,36.687]],[\"parent/22\",[9,1.391]],[\"name/23\",[19,36.687]],[\"parent/23\",[9,1.391]],[\"name/24\",[5,28.802]],[\"parent/24\",[9,1.391]],[\"name/25\",[6,28.802]],[\"parent/25\",[9,1.391]],[\"name/26\",[7,28.802]],[\"parent/26\",[9,1.391]],[\"name/27\",[20,36.687]],[\"parent/27\",[9,1.391]],[\"name/28\",[21,36.687]],[\"parent/28\",[9,1.391]],[\"name/29\",[8,28.802]],[\"parent/29\",[9,1.391]],[\"name/30\",[22,36.687]],[\"parent/30\",[9,1.391]],[\"name/31\",[23,36.687]],[\"parent/31\",[9,1.391]],[\"name/32\",[24,14.715]],[\"parent/32\",[]],[\"name/33\",[1,25.701]],[\"parent/33\",[24,1.391]],[\"name/34\",[10,36.687]],[\"parent/34\",[24,1.391]],[\"name/35\",[11,36.687]],[\"parent/35\",[24,1.391]],[\"name/36\",[25,41.795]],[\"parent/36\",[24,1.391]],[\"name/37\",[13,36.687]],[\"parent/37\",[24,1.391]],[\"name/38\",[14,36.687]],[\"parent/38\",[24,1.391]],[\"name/39\",[15,36.687]],[\"parent/39\",[24,1.391]],[\"name/40\",[0,18.441]],[\"parent/40\",[24,1.391]],[\"name/41\",[16,36.687]],[\"parent/41\",[24,1.391]],[\"name/42\",[17,36.687]],[\"parent/42\",[24,1.391]],[\"name/43\",[4,28.802]],[\"parent/43\",[24,1.391]],[\"name/44\",[18,36.687]],[\"parent/44\",[24,1.391]],[\"name/45\",[19,36.687]],[\"parent/45\",[24,1.391]],[\"name/46\",[5,28.802]],[\"parent/46\",[24,1.391]],[\"name/47\",[6,28.802]],[\"parent/47\",[24,1.391]],[\"name/48\",[7,28.802]],[\"parent/48\",[24,1.391]],[\"name/49\",[20,36.687]],[\"parent/49\",[24,1.391]],[\"name/50\",[21,36.687]],[\"parent/50\",[24,1.391]],[\"name/51\",[8,28.802]],[\"parent/51\",[24,1.391]],[\"name/52\",[22,36.687]],[\"parent/52\",[24,1.391]],[\"name/53\",[23,36.687]],[\"parent/53\",[24,1.391]],[\"name/54\",[26,19.823]],[\"parent/54\",[]],[\"name/55\",[1,25.701]],[\"parent/55\",[26,1.874]],[\"name/56\",[27,41.795]],[\"parent/56\",[26,1.874]],[\"name/57\",[0,18.441]],[\"parent/57\",[26,1.874]],[\"name/58\",[28,41.795]],[\"parent/58\",[26,1.874]],[\"name/59\",[29,41.795]],[\"parent/59\",[26,1.874]],[\"name/60\",[4,28.802]],[\"parent/60\",[26,1.874]],[\"name/61\",[5,28.802]],[\"parent/61\",[26,1.874]],[\"name/62\",[6,28.802]],[\"parent/62\",[26,1.874]],[\"name/63\",[7,28.802]],[\"parent/63\",[26,1.874]],[\"name/64\",[30,41.795]],[\"parent/64\",[26,1.874]],[\"name/65\",[8,28.802]],[\"parent/65\",[26,1.874]],[\"name/66\",[31,41.795]],[\"parent/66\",[26,1.874]],[\"name/67\",[32,33.322]],[\"parent/67\",[]],[\"name/68\",[33,41.795]],[\"parent/68\",[32,3.15]],[\"name/69\",[34,41.795]],[\"parent/69\",[32,3.15]],[\"name/70\",[35,30.809]],[\"parent/70\",[]],[\"name/71\",[36,41.795]],[\"parent/71\",[35,2.913]],[\"name/72\",[37,33.322]],[\"parent/72\",[38,3.15]],[\"name/73\",[39,30.809]],[\"parent/73\",[38,3.15]],[\"name/74\",[1,25.701]],[\"parent/74\",[38,3.15]],[\"name/75\",[40,41.795]],[\"parent/75\",[35,2.913]],[\"name/76\",[37,33.322]],[\"parent/76\",[41,3.15]],[\"name/77\",[39,30.809]],[\"parent/77\",[41,3.15]],[\"name/78\",[1,25.701]],[\"parent/78\",[41,3.15]],[\"name/79\",[42,41.795]],[\"parent/79\",[35,2.913]],[\"name/80\",[37,33.322]],[\"parent/80\",[43,3.15]],[\"name/81\",[39,30.809]],[\"parent/81\",[43,3.15]],[\"name/82\",[1,25.701]],[\"parent/82\",[43,3.15]],[\"name/83\",[44,36.687]],[\"parent/83\",[]],[\"name/84\",[39,30.809]],[\"parent/84\",[44,3.468]],[\"name/85\",[45,33.322]],[\"parent/85\",[]],[\"name/86\",[45,33.322]],[\"parent/86\",[45,3.15]],[\"name/87\",[46,25.701]],[\"parent/87\",[]],[\"name/88\",[4,28.802]],[\"parent/88\",[46,2.43]],[\"name/89\",[0,18.441]],[\"parent/89\",[46,2.43]],[\"name/90\",[5,28.802]],[\"parent/90\",[46,2.43]],[\"name/91\",[6,28.802]],[\"parent/91\",[46,2.43]],[\"name/92\",[7,28.802]],[\"parent/92\",[46,2.43]],[\"name/93\",[8,28.802]],[\"parent/93\",[46,2.43]],[\"name/94\",[47,41.795]],[\"parent/94\",[]],[\"name/95\",[48,41.795]],[\"parent/95\",[]],[\"name/96\",[49,41.795]],[\"parent/96\",[]]],\"invertedIndex\":[[\"__type\",{\"_index\":39,\"name\":{\"73\":{},\"77\":{},\"81\":{},\"84\":{}},\"parent\":{}}],[\"_count\",{\"_index\":3,\"name\":{\"3\":{}},\"parent\":{}}],[\"_lock\",{\"_index\":2,\"name\":{\"2\":{}},\"parent\":{}}],[\"_locks\",{\"_index\":27,\"name\":{\"56\":{}},\"parent\":{}}],[\"_readercount\",{\"_index\":14,\"name\":{\"16\":{},\"38\":{}},\"parent\":{}}],[\"_writercount\",{\"_index\":15,\"name\":{\"17\":{},\"39\":{}},\"parent\":{}}],[\"constructor\",{\"_index\":1,\"name\":{\"1\":{},\"11\":{},\"33\":{},\"55\":{},\"74\":{},\"78\":{},\"82\":{}},\"parent\":{}}],[\"count\",{\"_index\":4,\"name\":{\"5\":{},\"21\":{},\"43\":{},\"60\":{},\"88\":{}},\"parent\":{}}],[\"description\",{\"_index\":37,\"name\":{\"72\":{},\"76\":{},\"80\":{}},\"parent\":{}}],[\"errorasynclocks\",{\"_index\":36,\"name\":{\"71\":{}},\"parent\":{}}],[\"errorasynclockslockboxconflict\",{\"_index\":42,\"name\":{\"79\":{}},\"parent\":{}}],[\"errorasynclockstimeout\",{\"_index\":40,\"name\":{\"75\":{}},\"parent\":{}}],[\"errors\",{\"_index\":35,\"name\":{\"70\":{}},\"parent\":{\"71\":{},\"75\":{},\"79\":{}}}],[\"errors.errorasynclocks\",{\"_index\":38,\"name\":{},\"parent\":{\"72\":{},\"73\":{},\"74\":{}}}],[\"errors.errorasynclockslockboxconflict\",{\"_index\":43,\"name\":{},\"parent\":{\"80\":{},\"81\":{},\"82\":{}}}],[\"errors.errorasynclockstimeout\",{\"_index\":41,\"name\":{},\"parent\":{\"76\":{},\"77\":{},\"78\":{}}}],[\"islocked\",{\"_index\":5,\"name\":{\"6\":{},\"24\":{},\"46\":{},\"61\":{},\"90\":{}},\"parent\":{}}],[\"lock\",{\"_index\":0,\"name\":{\"0\":{},\"4\":{},\"18\":{},\"40\":{},\"57\":{},\"89\":{}},\"parent\":{\"1\":{},\"2\":{},\"3\":{},\"4\":{},\"5\":{},\"6\":{},\"7\":{},\"8\":{},\"9\":{}}}],[\"lockable\",{\"_index\":46,\"name\":{\"87\":{}},\"parent\":{\"88\":{},\"89\":{},\"90\":{},\"91\":{},\"92\":{},\"93\":{}}}],[\"lockbox\",{\"_index\":26,\"name\":{\"54\":{}},\"parent\":{\"55\":{},\"56\":{},\"57\":{},\"58\":{},\"59\":{},\"60\":{},\"61\":{},\"62\":{},\"63\":{},\"64\":{},\"65\":{},\"66\":{}}}],[\"lockmulti\",{\"_index\":28,\"name\":{\"58\":{}},\"parent\":{}}],[\"locks\",{\"_index\":29,\"name\":{\"59\":{}},\"parent\":{}}],[\"multilockacquire\",{\"_index\":48,\"name\":{\"95\":{}},\"parent\":{}}],[\"multilockacquired\",{\"_index\":49,\"name\":{\"96\":{}},\"parent\":{}}],[\"multilockrequest\",{\"_index\":47,\"name\":{\"94\":{}},\"parent\":{}}],[\"pojo\",{\"_index\":44,\"name\":{\"83\":{}},\"parent\":{\"84\":{}}}],[\"read\",{\"_index\":16,\"name\":{\"19\":{},\"41\":{}},\"parent\":{}}],[\"readercount\",{\"_index\":18,\"name\":{\"22\":{},\"44\":{}},\"parent\":{}}],[\"readercountblocked\",{\"_index\":13,\"name\":{\"15\":{},\"37\":{}},\"parent\":{}}],[\"readerslock\",{\"_index\":10,\"name\":{\"12\":{},\"34\":{}},\"parent\":{}}],[\"readersrelease\",{\"_index\":25,\"name\":{\"36\":{}},\"parent\":{}}],[\"rwlockreader\",{\"_index\":9,\"name\":{\"10\":{}},\"parent\":{\"11\":{},\"12\":{},\"13\":{},\"14\":{},\"15\":{},\"16\":{},\"17\":{},\"18\":{},\"19\":{},\"20\":{},\"21\":{},\"22\":{},\"23\":{},\"24\":{},\"25\":{},\"26\":{},\"27\":{},\"28\":{},\"29\":{},\"30\":{},\"31\":{}}}],[\"rwlockwriter\",{\"_index\":24,\"name\":{\"32\":{}},\"parent\":{\"33\":{},\"34\":{},\"35\":{},\"36\":{},\"37\":{},\"38\":{},\"39\":{},\"40\":{},\"41\":{},\"42\":{},\"43\":{},\"44\":{},\"45\":{},\"46\":{},\"47\":{},\"48\":{},\"49\":{},\"50\":{},\"51\":{},\"52\":{},\"53\":{}}}],[\"sleep\",{\"_index\":33,\"name\":{\"68\":{}},\"parent\":{}}],[\"tostring\",{\"_index\":45,\"name\":{\"85\":{},\"86\":{}},\"parent\":{\"86\":{}}}],[\"utils\",{\"_index\":32,\"name\":{\"67\":{}},\"parent\":{\"68\":{},\"69\":{}}}],[\"waitforunlock\",{\"_index\":6,\"name\":{\"7\":{},\"25\":{},\"47\":{},\"62\":{},\"91\":{}},\"parent\":{}}],[\"withf\",{\"_index\":7,\"name\":{\"8\":{},\"26\":{},\"48\":{},\"63\":{},\"92\":{}},\"parent\":{}}],[\"withg\",{\"_index\":8,\"name\":{\"9\":{},\"29\":{},\"51\":{},\"65\":{},\"93\":{}},\"parent\":{}}],[\"withmultif\",{\"_index\":30,\"name\":{\"64\":{}},\"parent\":{}}],[\"withmultig\",{\"_index\":31,\"name\":{\"66\":{}},\"parent\":{}}],[\"withreadf\",{\"_index\":20,\"name\":{\"27\":{},\"49\":{}},\"parent\":{}}],[\"withreadg\",{\"_index\":22,\"name\":{\"30\":{},\"52\":{}},\"parent\":{}}],[\"withwritef\",{\"_index\":21,\"name\":{\"28\":{},\"50\":{}},\"parent\":{}}],[\"withwriteg\",{\"_index\":23,\"name\":{\"31\":{},\"53\":{}},\"parent\":{}}],[\"write\",{\"_index\":17,\"name\":{\"20\":{},\"42\":{}},\"parent\":{}}],[\"writercount\",{\"_index\":19,\"name\":{\"23\":{},\"45\":{}},\"parent\":{}}],[\"writerslock\",{\"_index\":11,\"name\":{\"13\":{},\"35\":{}},\"parent\":{}}],[\"writersrelease\",{\"_index\":12,\"name\":{\"14\":{}},\"parent\":{}}],[\"yieldmicro\",{\"_index\":34,\"name\":{\"69\":{}},\"parent\":{}}]],\"pipeline\":[]}}"); \ No newline at end of file diff --git a/docs/classes/Lock.html b/docs/classes/Lock.html index afc3b42..4219c58 100644 --- a/docs/classes/Lock.html +++ b/docs/classes/Lock.html @@ -1 +1 @@ -Lock | @matrixai/async-locks
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Lock

Implements

Index

Constructors

Properties

_count: number = 0
_lock: Mutex = ...

Accessors

  • get count(): number

Methods

  • isLocked(): boolean
  • lock(timeout?: number): ResourceAcquire<Lock>
  • waitForUnlock(timeout?: number): Promise<void>
  • withF<T>(...params: [number, (lock: Lock) => Promise<T>] | [(lock: Lock) => Promise<T>]): Promise<T>
  • Type parameters

    • T

    Parameters

    • Rest ...params: [number, (lock: Lock) => Promise<T>] | [(lock: Lock) => Promise<T>]

    Returns Promise<T>

  • withG<T, TReturn, TNext>(...params: [(lock: Lock) => AsyncGenerator<T, TReturn, TNext>] | [number, (lock: Lock) => AsyncGenerator<T, TReturn, TNext>]): AsyncGenerator<T, TReturn, TNext>
  • Type parameters

    • T

    • TReturn

    • TNext

    Parameters

    • Rest ...params: [(lock: Lock) => AsyncGenerator<T, TReturn, TNext>] | [number, (lock: Lock) => AsyncGenerator<T, TReturn, TNext>]

    Returns AsyncGenerator<T, TReturn, TNext>

Generated using TypeDoc

\ No newline at end of file +Lock | @matrixai/async-locks
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Lock

Implements

Index

Constructors

Properties

_count: number = 0
_lock: Mutex = ...

Accessors

  • get count(): number

Methods

  • isLocked(): boolean
  • lock(timeout?: number): ResourceAcquire<Lock>
  • waitForUnlock(timeout?: number): Promise<void>
  • withF<T>(...params: [number, (lock: Lock) => Promise<T>] | [(lock: Lock) => Promise<T>]): Promise<T>
  • Type parameters

    • T

    Parameters

    • Rest ...params: [number, (lock: Lock) => Promise<T>] | [(lock: Lock) => Promise<T>]

    Returns Promise<T>

  • withG<T, TReturn, TNext>(...params: [(lock: Lock) => AsyncGenerator<T, TReturn, TNext>] | [number, (lock: Lock) => AsyncGenerator<T, TReturn, TNext>]): AsyncGenerator<T, TReturn, TNext>
  • Type parameters

    • T

    • TReturn

    • TNext

    Parameters

    • Rest ...params: [(lock: Lock) => AsyncGenerator<T, TReturn, TNext>] | [number, (lock: Lock) => AsyncGenerator<T, TReturn, TNext>]

    Returns AsyncGenerator<T, TReturn, TNext>

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/LockBox.html b/docs/classes/LockBox.html index dcfb21c..1415fcb 100644 --- a/docs/classes/LockBox.html +++ b/docs/classes/LockBox.html @@ -1 +1 @@ -LockBox | @matrixai/async-locks
Options
All
  • Public
  • Public/Protected
  • All
Menu

Type parameters

Hierarchy

  • LockBox

Implements

Index

Constructors

Properties

_locks: Map<string, L> = ...

Accessors

  • get count(): number
  • get locks(): ReadonlyMap<string, L>

Methods

  • isLocked(key?: ToString, ...params: Parameters<L["isLocked"]>): boolean
  • lock(...requests: [key: ToString, lockConstructor: new () => L, ...lockingParams: Parameters<L["lock"]>[]][]): ResourceAcquire<LockBox<L>>
  • waitForUnlock(timeout?: number, key?: ToString): Promise<void>
  • withF<T>(...params: [...requests: [key: ToString, lockConstructor: new () => L, ...lockingParams: Parameters<L["lock"]>[]][], f: (lockBox: LockBox<L>) => Promise<T>]): Promise<T>
  • Type parameters

    • T

    Parameters

    • Rest ...params: [...requests: [key: ToString, lockConstructor: new () => L, ...lockingParams: Parameters<L["lock"]>[]][], f: (lockBox: LockBox<L>) => Promise<T>]

    Returns Promise<T>

  • withG<T, TReturn, TNext>(...params: [...requests: [key: ToString, lockConstructor: new () => L, ...lockingParams: Parameters<L["lock"]>[]][], g: (lockBox: LockBox<L>) => AsyncGenerator<T, TReturn, TNext>]): AsyncGenerator<T, TReturn, TNext>
  • Type parameters

    • T

    • TReturn

    • TNext

    Parameters

    • Rest ...params: [...requests: [key: ToString, lockConstructor: new () => L, ...lockingParams: Parameters<L["lock"]>[]][], g: (lockBox: LockBox<L>) => AsyncGenerator<T, TReturn, TNext>]

    Returns AsyncGenerator<T, TReturn, TNext>

Generated using TypeDoc

\ No newline at end of file +LockBox | @matrixai/async-locks
Options
All
  • Public
  • Public/Protected
  • All
Menu

Type parameters

Hierarchy

  • LockBox

Implements

Index

Constructors

Properties

_locks: Map<string, L> = ...

Accessors

  • get count(): number
  • get locks(): ReadonlyMap<string, L>

Methods

  • isLocked(key?: ToString, ...params: Parameters<L["isLocked"]>): boolean
  • lock(...requests: [key: ToString, lockConstructor: new () => L, ...lockingParams: Parameters<L["lock"]>[]][]): ResourceAcquire<LockBox<L>>
  • lockMulti(...requests: [key: ToString, lockConstructor: new () => L, ...lockingParams: Parameters<L["lock"]>[]][]): [key: ToString, lockAcquire: ResourceAcquire<L>, ...lockingParams: Parameters<L["lock"]>[]][]
  • Parameters

    • Rest ...requests: [key: ToString, lockConstructor: new () => L, ...lockingParams: Parameters<L["lock"]>[]][]

    Returns [key: ToString, lockAcquire: ResourceAcquire<L>, ...lockingParams: Parameters<L["lock"]>[]][]

  • waitForUnlock(timeout?: number, key?: ToString): Promise<void>
  • withF<T>(...params: [...requests: [key: ToString, lockConstructor: new () => L, ...lockingParams: Parameters<L["lock"]>[]][], f: (lockBox: LockBox<L>) => Promise<T>]): Promise<T>
  • Type parameters

    • T

    Parameters

    • Rest ...params: [...requests: [key: ToString, lockConstructor: new () => L, ...lockingParams: Parameters<L["lock"]>[]][], f: (lockBox: LockBox<L>) => Promise<T>]

    Returns Promise<T>

  • withG<T, TReturn, TNext>(...params: [...requests: [key: ToString, lockConstructor: new () => L, ...lockingParams: Parameters<L["lock"]>[]][], g: (lockBox: LockBox<L>) => AsyncGenerator<T, TReturn, TNext>]): AsyncGenerator<T, TReturn, TNext>
  • Type parameters

    • T

    • TReturn

    • TNext

    Parameters

    • Rest ...params: [...requests: [key: ToString, lockConstructor: new () => L, ...lockingParams: Parameters<L["lock"]>[]][], g: (lockBox: LockBox<L>) => AsyncGenerator<T, TReturn, TNext>]

    Returns AsyncGenerator<T, TReturn, TNext>

  • withMultiF<T>(...params: [...requests: [key: ToString, lockConstructor: new () => L, ...lockingParams: Parameters<L["lock"]>[]][], f: (multiLocks: [key: ToString, lock: L, ...lockingParams: Parameters<L["lock"]>[]][]) => Promise<T>]): Promise<T>
  • Type parameters

    • T

    Parameters

    • Rest ...params: [...requests: [key: ToString, lockConstructor: new () => L, ...lockingParams: Parameters<L["lock"]>[]][], f: (multiLocks: [key: ToString, lock: L, ...lockingParams: Parameters<L["lock"]>[]][]) => Promise<T>]

    Returns Promise<T>

  • withMultiG<T, TReturn, TNext>(...params: [...requests: [key: ToString, lockConstructor: new () => L, ...lockingParams: Parameters<L["lock"]>[]][], g: (multiLocks: [key: ToString, lock: L, ...lockingParams: Parameters<L["lock"]>[]][]) => AsyncGenerator<T, TReturn, TNext>]): AsyncGenerator<T, TReturn, TNext>
  • Type parameters

    • T

    • TReturn

    • TNext

    Parameters

    • Rest ...params: [...requests: [key: ToString, lockConstructor: new () => L, ...lockingParams: Parameters<L["lock"]>[]][], g: (multiLocks: [key: ToString, lock: L, ...lockingParams: Parameters<L["lock"]>[]][]) => AsyncGenerator<T, TReturn, TNext>]

    Returns AsyncGenerator<T, TReturn, TNext>

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/RWLockReader.html b/docs/classes/RWLockReader.html index a9ee833..8d847ab 100644 --- a/docs/classes/RWLockReader.html +++ b/docs/classes/RWLockReader.html @@ -1,6 +1,6 @@ RWLockReader | @matrixai/async-locks
Options
All
  • Public
  • Public/Protected
  • All
Menu

Read-preferring read write lock

-

Hierarchy

  • RWLockReader

Implements

Index

Constructors

Properties

_readerCount: number = 0
_writerCount: number = 0
readerCountBlocked: number = 0
readersLock: Mutex = ...
writersLock: Mutex = ...
writersRelease: Releaser

Accessors

  • get count(): number
  • get readerCount(): number
  • get writerCount(): number

Methods

  • isLocked(): boolean

Hierarchy

  • RWLockReader

Implements

Index

Constructors

Properties

_readerCount: number = 0
_writerCount: number = 0
readerCountBlocked: number = 0
readersLock: Mutex = ...
writersLock: Mutex = ...
writersRelease: Releaser

Accessors

  • get count(): number
  • get readerCount(): number
  • get writerCount(): number

Methods

  • isLocked(): boolean
  • lock(type: "read" | "write", timeout?: number): ResourceAcquire<RWLockReader>
  • waitForUnlock(timeout?: number): Promise<void>
  • withF<T>(...params: [(lock: RWLockReader) => Promise<T>] | ["read" | "write", number, (lock: RWLockReader) => Promise<T>] | ["read" | "write", (lock: RWLockReader) => Promise<T>]): Promise<T>
  • withG<T, TReturn, TNext>(...params: [(lock: RWLockReader) => AsyncGenerator<T, TReturn, TNext>] | ["read" | "write", number, (lock: RWLockReader) => AsyncGenerator<T, TReturn, TNext>] | ["read" | "write", (lock: RWLockReader) => AsyncGenerator<T, TReturn, TNext>]): AsyncGenerator<T, TReturn, TNext>
  • Type parameters

    • T

    • TReturn

    • TNext

    Parameters

    • Rest ...params: [(lock: RWLockReader) => AsyncGenerator<T, TReturn, TNext>] | ["read" | "write", number, (lock: RWLockReader) => AsyncGenerator<T, TReturn, TNext>] | ["read" | "write", (lock: RWLockReader) => AsyncGenerator<T, TReturn, TNext>]

    Returns AsyncGenerator<T, TReturn, TNext>

  • withReadF<T>(...params: [(lock: RWLockReader) => Promise<T>] | [number, (lock: RWLockReader) => Promise<T>]): Promise<T>
  • withReadG<T, TReturn, TNext>(...params: [(lock: RWLockReader) => AsyncGenerator<T, TReturn, TNext>] | [number, (lock: RWLockReader) => AsyncGenerator<T, TReturn, TNext>]): AsyncGenerator<T, TReturn, TNext>
  • Type parameters

    • T

    • TReturn

    • TNext

    Parameters

    • Rest ...params: [(lock: RWLockReader) => AsyncGenerator<T, TReturn, TNext>] | [number, (lock: RWLockReader) => AsyncGenerator<T, TReturn, TNext>]

    Returns AsyncGenerator<T, TReturn, TNext>

  • withWriteF<T>(...params: [(lock: RWLockReader) => Promise<T>] | [number, (lock: RWLockReader) => Promise<T>]): Promise<T>
  • withWriteG<T, TReturn, TNext>(...params: [(lock: RWLockReader) => AsyncGenerator<T, TReturn, TNext>] | [number, (lock: RWLockReader) => AsyncGenerator<T, TReturn, TNext>]): AsyncGenerator<T, TReturn, TNext>
  • Type parameters

    • T

    • TReturn

    • TNext

    Parameters

    • Rest ...params: [(lock: RWLockReader) => AsyncGenerator<T, TReturn, TNext>] | [number, (lock: RWLockReader) => AsyncGenerator<T, TReturn, TNext>]

    Returns AsyncGenerator<T, TReturn, TNext>

Generated using TypeDoc

\ No newline at end of file +

Returns boolean

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/RWLockWriter.html b/docs/classes/RWLockWriter.html index 56afe8c..2315838 100644 --- a/docs/classes/RWLockWriter.html +++ b/docs/classes/RWLockWriter.html @@ -1,6 +1,6 @@ RWLockWriter | @matrixai/async-locks
Options
All
  • Public
  • Public/Protected
  • All
Menu

Write-preferring read write lock

-

Hierarchy

  • RWLockWriter

Implements

Index

Constructors

Properties

_readerCount: number = 0
_writerCount: number = 0
readerCountBlocked: number = 0
readersLock: Mutex = ...
readersRelease: Releaser
writersLock: Mutex = ...

Accessors

  • get count(): number
  • get readerCount(): number
  • get writerCount(): number

Methods

  • isLocked(type?: "read" | "write"): boolean

Hierarchy

  • RWLockWriter

Implements

Index

Constructors

Properties

_readerCount: number = 0
_writerCount: number = 0
readerCountBlocked: number = 0
readersLock: Mutex = ...
readersRelease: Releaser
writersLock: Mutex = ...

Accessors

  • get count(): number
  • get readerCount(): number
  • get writerCount(): number

Methods

  • isLocked(type?: "read" | "write"): boolean
  • Check if locked If passed type, it will also check that the active lock is of that type

    -

    Parameters

    • Optional type: "read" | "write"

    Returns boolean

  • lock(type: "read" | "write", timeout?: number): ResourceAcquire<RWLockWriter>
  • waitForUnlock(timeout?: number): Promise<void>
  • withF<T>(...params: [(lock: RWLockWriter) => Promise<T>] | ["read" | "write", number, (lock: RWLockWriter) => Promise<T>] | ["read" | "write", (lock: RWLockWriter) => Promise<T>]): Promise<T>
  • withG<T, TReturn, TNext>(...params: [(lock: RWLockWriter) => AsyncGenerator<T, TReturn, TNext>] | ["read" | "write", number, (lock: RWLockWriter) => AsyncGenerator<T, TReturn, TNext>] | ["read" | "write", (lock: RWLockWriter) => AsyncGenerator<T, TReturn, TNext>]): AsyncGenerator<T, TReturn, TNext>
  • Type parameters

    • T

    • TReturn

    • TNext

    Parameters

    • Rest ...params: [(lock: RWLockWriter) => AsyncGenerator<T, TReturn, TNext>] | ["read" | "write", number, (lock: RWLockWriter) => AsyncGenerator<T, TReturn, TNext>] | ["read" | "write", (lock: RWLockWriter) => AsyncGenerator<T, TReturn, TNext>]

    Returns AsyncGenerator<T, TReturn, TNext>

  • withReadF<T>(...params: [(lock: RWLockWriter) => Promise<T>] | [number, (lock: RWLockWriter) => Promise<T>]): Promise<T>
  • withReadG<T, TReturn, TNext>(...params: [(lock: RWLockWriter) => AsyncGenerator<T, TReturn, TNext>] | [number, (lock: RWLockWriter) => AsyncGenerator<T, TReturn, TNext>]): AsyncGenerator<T, TReturn, TNext>
  • Type parameters

    • T

    • TReturn

    • TNext

    Parameters

    • Rest ...params: [(lock: RWLockWriter) => AsyncGenerator<T, TReturn, TNext>] | [number, (lock: RWLockWriter) => AsyncGenerator<T, TReturn, TNext>]

    Returns AsyncGenerator<T, TReturn, TNext>

  • withWriteF<T>(...params: [(lock: RWLockWriter) => Promise<T>] | [number, (lock: RWLockWriter) => Promise<T>]): Promise<T>
  • withWriteG<T, TReturn, TNext>(...params: [(lock: RWLockWriter) => AsyncGenerator<T, TReturn, TNext>] | [number, (lock: RWLockWriter) => AsyncGenerator<T, TReturn, TNext>]): AsyncGenerator<T, TReturn, TNext>
  • Type parameters

    • T

    • TReturn

    • TNext

    Parameters

    • Rest ...params: [(lock: RWLockWriter) => AsyncGenerator<T, TReturn, TNext>] | [number, (lock: RWLockWriter) => AsyncGenerator<T, TReturn, TNext>]

    Returns AsyncGenerator<T, TReturn, TNext>

Generated using TypeDoc

\ No newline at end of file +

Parameters

Returns boolean

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 0d73739..30c1018 100644 --- a/docs/index.html +++ b/docs/index.html @@ -31,4 +31,4 @@

Publishing

# npm login
npm version patch # major/minor/patch
npm run build
npm publish --access public
git push
git push --tags
-

Generated using TypeDoc

\ No newline at end of file +

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/modules.html b/docs/modules.html index 7e7b931..f9fc8c5 100644 --- a/docs/modules.html +++ b/docs/modules.html @@ -1,3 +1,3 @@ -@matrixai/async-locks
Options
All
  • Public
  • Public/Protected
  • All
Menu

@matrixai/async-locks

Index

Type aliases

LockRequest<L>: [key: ToString, lockConstructor: new () => L, lockingParams: Parameters<L["lock"]>]

Type parameters

POJO: {}
+@matrixai/async-locks
Options
All
  • Public
  • Public/Protected
  • All
Menu

@matrixai/async-locks

Index

Type aliases

MultiLockAcquire<L>: [key: ToString, lockAcquire: ResourceAcquire<L>, lockingParams: Parameters<L["lock"]>]

Type parameters

MultiLockAcquired<L>: [key: ToString, lock: L, lockingParams: Parameters<L["lock"]>]

Type parameters

MultiLockRequest<L>: [key: ToString, lockConstructor: new () => L, lockingParams: Parameters<L["lock"]>]

Type parameters

POJO: {}

Plain data dictionary

-

Type declaration

  • [key: string]: any

Legend

  • Property
  • Method
  • Constructor
  • Method
  • Protected property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +

Type declaration

  • [key: string]: any

Generated using TypeDoc

\ No newline at end of file diff --git a/src/Lock.ts b/src/Lock.ts index 6184213..f6161f3 100644 --- a/src/Lock.ts +++ b/src/Lock.ts @@ -24,8 +24,11 @@ class Lock implements Lockable { --this._count; throw e; } + let released = false; return [ async () => { + if (released) return; + released = true; --this._count; release(); // Allow semaphore to settle https://github.com/DirtyHairy/async-mutex/issues/54 diff --git a/src/LockBox.ts b/src/LockBox.ts index 0e731dc..ace9726 100644 --- a/src/LockBox.ts +++ b/src/LockBox.ts @@ -1,12 +1,20 @@ import type { ResourceAcquire, ResourceRelease } from '@matrixai/resources'; -import type { Lockable, ToString, LockRequest } from './types'; +import type { + ToString, + Lockable, + MultiLockRequest, + MultiLockAcquire, + MultiLockAcquired, +} from './types'; import { withF, withG } from '@matrixai/resources'; import { ErrorAsyncLocksLockBoxConflict } from './errors'; -class LockBox implements Lockable { +class LockBox implements Lockable { protected _locks: Map = new Map(); - public lock(...requests: Array>): ResourceAcquire> { + public lock( + ...requests: Array> + ): ResourceAcquire> { return async () => { // Convert to strings // This creates a copy of the requests @@ -26,42 +34,48 @@ class LockBox implements Lockable { ([key], i, arr) => i === 0 || key !== arr[i - 1][0], ); const locks: Array<[string, ResourceRelease, L]> = []; - for (const [key, LockConstructor, ...lockingParams] of requests_) { - let lock = this._locks.get(key); - if (lock == null) { - lock = new LockConstructor(); - this._locks.set(key, lock); - } else { - // It is possible to swap the lock class, but only after the lock key is released - if (!(lock instanceof LockConstructor)) { - throw new ErrorAsyncLocksLockBoxConflict( - `Lock ${key} is already locked with class ${lock.constructor.name}, which conflicts with class ${LockConstructor.name}`, - ); + try { + for (const [key, LockConstructor, ...lockingParams] of requests_) { + let lock = this._locks.get(key); + if (lock == null) { + lock = new LockConstructor(); + this._locks.set(key, lock); + } else { + // It is possible to swap the lock class, but only after the lock key is released + if (!(lock instanceof LockConstructor)) { + throw new ErrorAsyncLocksLockBoxConflict( + `Lock ${key} is already locked with class ${lock.constructor.name}, which conflicts with class ${LockConstructor.name}`, + ); + } } + const lockAcquire = lock.lock(...lockingParams); + const [lockRelease] = await lockAcquire(); + locks.push([key, lockRelease, lock]); } - const lockAcquire = lock.lock(...lockingParams); - let lockRelease: ResourceRelease; - try { - [lockRelease] = await lockAcquire(); - } catch (e) { - // Release all intermediate locks in reverse order - locks.reverse(); - for (const [key, lockRelease, lock] of locks) { - await lockRelease(); - if (!lock.isLocked()) { - this._locks.delete(key); - } + } catch (e) { + // Release all intermediate locks in reverse order + locks.reverse(); + for (const [key, lockRelease, lock] of locks) { + await lockRelease(); + // If it is still locked, then it is held by a different context + // only delete if no contexts are locking the lock + if (!lock.isLocked()) { + this._locks.delete(key); } - throw e; } - locks.push([key, lockRelease, lock]); + throw e; } + let released = false; return [ async () => { + if (released) return; + released = true; // Release all locks in reverse order locks.reverse(); for (const [key, lockRelease, lock] of locks) { await lockRelease(); + // If it is still locked, then it is held by a different context + // only delete if no contexts are locking the lock if (!lock.isLocked()) { this._locks.delete(key); } @@ -72,6 +86,76 @@ class LockBox implements Lockable { }; } + public lockMulti( + ...requests: Array> + ): Array> { + // Convert to strings + // This creates a copy of the requests + let requests_: Array< + [string, ToString, new () => L, ...Parameters] + > = requests.map(([key, ...rest]) => + typeof key === 'string' + ? [key, key, ...rest] + : [key.toString(), key, ...rest], + ); + // Sort to ensure lock hierarchy + requests_.sort(([key1], [key2]) => { + // Deterministic string comparison according to 16-bit code units + if (key1 < key2) return -1; + if (key1 > key2) return 1; + return 0; + }); + // Avoid duplicate locking + requests_ = requests_.filter( + ([key], i, arr) => i === 0 || key !== arr[i - 1][0], + ); + const lockAcquires: Array> = []; + for (const [key, keyOrig, LockConstructor, ...lockingParams] of requests_) { + const lockAcquire: ResourceAcquire = async () => { + let lock = this._locks.get(key); + let lockRelease: ResourceRelease; + try { + if (lock == null) { + lock = new LockConstructor(); + this._locks.set(key, lock); + } else { + // It is possible to swap the lock class, but only after the lock key is released + if (!(lock instanceof LockConstructor)) { + throw new ErrorAsyncLocksLockBoxConflict( + `Lock ${key} is already locked with class ${lock.constructor.name}, which conflicts with class ${LockConstructor.name}`, + ); + } + } + const lockAcquire = lock.lock(...lockingParams); + [lockRelease] = await lockAcquire(); + } catch (e) { + // If it is still locked, then it is held by a different context + // only delete if no contexts are locking the lock + if (!lock!.isLocked()) { + this._locks.delete(key); + } + throw e; + } + let released = false; + return [ + async () => { + if (released) return; + released = true; + await lockRelease(); + // If it is still locked, then it is held by a different context + // only delete if no contexts are locking the lock + if (!lock!.isLocked()) { + this._locks.delete(key); + } + }, + lock, + ]; + }; + lockAcquires.push([keyOrig, lockAcquire, ...lockingParams]); + } + return lockAcquires; + } + get locks(): ReadonlyMap { return this._locks; } @@ -116,20 +200,48 @@ class LockBox implements Lockable { public async withF( ...params: [ - ...requests: Array>, + ...requests: Array>, f: (lockBox: LockBox) => Promise, ] ): Promise { const f = params.pop() as (lockBox: LockBox) => Promise; return withF( - [this.lock(...(params as Array>))], + [this.lock(...(params as Array>))], ([lockBox]) => f(lockBox), ); } + public async withMultiF( + ...params: [ + ...requests: Array>, + f: (multiLocks: Array>) => Promise, + ] + ): Promise { + const f = params.pop() as ( + multiLocks: Array>, + ) => Promise; + const lockAcquires = this.lockMulti( + ...(params as Array>), + ); + + const lockAcquires_: Array>> = + lockAcquires.map( + ([key, lockAcquire, ...lockingParams]) => + (...r) => + lockAcquire(...r).then( + ([lockRelease, lock]) => + [lockRelease, [key, lock, ...lockingParams]] as [ + ResourceRelease, + MultiLockAcquired, + ], + ), + ); + return withF(lockAcquires_, f); + } + public withG( ...params: [ - ...requests: Array>, + ...requests: Array>, g: (lockBox: LockBox) => AsyncGenerator, ] ): AsyncGenerator { @@ -137,10 +249,39 @@ class LockBox implements Lockable { lockBox: LockBox, ) => AsyncGenerator; return withG( - [this.lock(...(params as Array>))], + [this.lock(...(params as Array>))], ([lockBox]) => g(lockBox), ); } + + public withMultiG( + ...params: [ + ...requests: Array>, + g: ( + multiLocks: Array>, + ) => AsyncGenerator, + ] + ) { + const g = params.pop() as ( + multiLocks: Array>, + ) => AsyncGenerator; + const lockAcquires = this.lockMulti( + ...(params as Array>), + ); + const lockAcquires_: Array>> = + lockAcquires.map( + ([key, lockAcquire, ...lockingParams]) => + (...r) => + lockAcquire(...r).then( + ([lockRelease, lock]) => + [lockRelease, [key, lock, ...lockingParams]] as [ + ResourceRelease, + MultiLockAcquired, + ], + ), + ); + return withG(lockAcquires_, g); + } } export default LockBox; diff --git a/src/RWLockReader.ts b/src/RWLockReader.ts index 5d7c8d6..7292725 100644 --- a/src/RWLockReader.ts +++ b/src/RWLockReader.ts @@ -18,7 +18,7 @@ class RWLockReader implements Lockable { protected _writerCount: number = 0; public lock( - type: 'read' | 'write', + type: 'read' | 'write' = 'write', timeout?: number, ): ResourceAcquire { switch (type) { @@ -74,8 +74,11 @@ class RWLockReader implements Lockable { // Yield for the first reader to finish locking await yieldMicro(); } + let released = false; return [ async () => { + if (released) return; + released = true; readersRelease = await this.readersLock.acquire(); const readerCount = --this._readerCount; // The last reader unlocks @@ -109,8 +112,11 @@ class RWLockReader implements Lockable { --this._writerCount; throw e; } + let released = false; return [ async () => { + if (released) return; + released = true; release(); --this._writerCount; // Allow semaphore to settle https://github.com/DirtyHairy/async-mutex/issues/54 diff --git a/src/RWLockWriter.ts b/src/RWLockWriter.ts index 766e95c..1d558e0 100644 --- a/src/RWLockWriter.ts +++ b/src/RWLockWriter.ts @@ -19,7 +19,7 @@ class RWLockWriter implements Lockable { protected _writerCount: number = 0; public lock( - type: 'read' | 'write', + type: 'read' | 'write' = 'write', timeout?: number, ): ResourceAcquire { switch (type) { @@ -74,8 +74,11 @@ class RWLockWriter implements Lockable { // Yield for the first reader to finish locking await yieldMicro(); } + let released = false; return [ async () => { + if (released) return; + released = true; const readerCount = --this._readerCount; // The last reader unlocks if (readerCount === 0) { @@ -126,8 +129,11 @@ class RWLockWriter implements Lockable { await yieldMicro(); throw e; } + let released = false; return [ async () => { + if (released) return; + released = true; this.readersRelease(); writersRelease(); --this._writerCount; diff --git a/src/types.ts b/src/types.ts index a706efe..15a4f09 100644 --- a/src/types.ts +++ b/src/types.ts @@ -23,10 +23,29 @@ interface Lockable { ): AsyncGenerator; } -type LockRequest = [ +type MultiLockRequest = [ key: ToString, lockConstructor: new () => L, ...lockingParams: Parameters, ]; -export type { POJO, ToString, Lockable, LockRequest }; +type MultiLockAcquire = [ + key: ToString, + lockAcquire: ResourceAcquire, + ...lockingParams: Parameters, +]; + +type MultiLockAcquired = [ + key: ToString, + lock: L, + ...lockingParams: Parameters, +]; + +export type { + POJO, + ToString, + Lockable, + MultiLockRequest, + MultiLockAcquire, + MultiLockAcquired, +}; diff --git a/tests/Lock.test.ts b/tests/Lock.test.ts index 5a176f9..125cb0f 100644 --- a/tests/Lock.test.ts +++ b/tests/Lock.test.ts @@ -212,4 +212,17 @@ describe(Lock.name, () => { await g.next(); await lock.waitForUnlock(100); }); + test('release is idempotent', async () => { + const lock = new Lock(); + let lockAcquire = lock.lock(); + let [lockRelease] = await lockAcquire(); + await lockRelease(); + await lockRelease(); + expect(lock.count).toBe(0); + lockAcquire = lock.lock(); + [lockRelease] = await lockAcquire(); + await lockRelease(); + await lockRelease(); + expect(lock.count).toBe(0); + }); }); diff --git a/tests/LockBox.test.ts b/tests/LockBox.test.ts index d181782..7721846 100644 --- a/tests/LockBox.test.ts +++ b/tests/LockBox.test.ts @@ -1,4 +1,5 @@ -import type { LockRequest } from '@/types'; +import type { ResourceRelease } from '@matrixai/resources'; +import type { MultiLockRequest } from '@/types'; import { withF, withG } from '@matrixai/resources'; import LockBox from '@/LockBox'; import Lock from '@/Lock'; @@ -338,7 +339,7 @@ describe(LockBox.name, () => { test('can map keys to LockBox locks', async () => { const lockBox = new LockBox(); const keys = ['1', '2', '3', '4']; - const locks: Array> = keys.map((key) => [ + const locks: Array> = keys.map((key) => [ key, RWLockWriter, 'write', @@ -347,4 +348,74 @@ describe(LockBox.name, () => { // NOP }); }); + test('release is idempotent', async () => { + const lockBox = new LockBox(); + let lockAcquire = lockBox.lock(['1', Lock], ['2', Lock]); + let [lockRelease] = await lockAcquire(); + await lockRelease(); + await lockRelease(); + expect(lockBox.count).toBe(0); + lockAcquire = lockBox.lock(['2', Lock], ['3', Lock]); + [lockRelease] = await lockAcquire(); + await lockRelease(); + await lockRelease(); + expect(lockBox.count).toBe(0); + }); + test('lockMulti provides fine grained lock acquisitions', async () => { + const lockBox = new LockBox(); + const lockAcquires = lockBox.lockMulti(['1', Lock], ['2', Lock]); + // Returned multi lock acquires should be sorted + expect(lockAcquires.map(([key]) => key)).toStrictEqual(['1', '2'].sort()); + const lockReleasers: Map = new Map(); + for (const [key, lockAcquire] of lockAcquires) { + const [lockRelease] = await lockAcquire(); + lockReleasers.set(key as string, lockRelease); + } + // Unlock '1' + await lockReleasers.get('1')!(); + // Lock releasing is idempotent + await lockReleasers.get('1')!(); + expect(lockBox.isLocked('1')).toBe(false); + expect(lockBox.isLocked('2')).toBe(true); + await lockBox.withF(['1', Lock], async () => { + expect(lockBox.isLocked('1')).toBe(true); + expect(lockBox.isLocked('2')).toBe(true); + }); + expect(lockBox.isLocked('1')).toBe(false); + expect(lockBox.isLocked('2')).toBe(true); + // Unlock '2' + await lockReleasers.get('2')!(); + await lockBox.withMultiF(['1', Lock], ['2', Lock], async (multiLocks) => { + expect(lockBox.isLocked('1')).toBe(true); + expect(lockBox.isLocked('2')).toBe(true); + const [[k1, l1], [k2, l2]] = multiLocks; + expect(k1).toBe('1'); + expect(k2).toBe('2'); + expect(l1.isLocked()).toBe(true); + expect(l2.isLocked()).toBe(true); + }); + const g = lockBox.withMultiG( + ['1', Lock], + ['2', Lock], + async function* (multiLocks): AsyncGenerator { + yield 'first'; + expect(lockBox.isLocked('1')).toBe(true); + expect(lockBox.isLocked('2')).toBe(true); + const [[k1, l1], [k2, l2]] = multiLocks; + yield 'second'; + expect(k1).toBe('1'); + expect(k2).toBe('2'); + expect(l1.isLocked()).toBe(true); + expect(l2.isLocked()).toBe(true); + return 'last'; + }, + ); + const vv: Array = []; + for await (const v of g) { + vv.push(v); + } + expect(vv).toStrictEqual(['first', 'second']); + expect(lockBox.isLocked('1')).toBe(false); + expect(lockBox.isLocked('2')).toBe(false); + }); }); diff --git a/tests/RWLockReader.test.ts b/tests/RWLockReader.test.ts index b648958..aada53f 100644 --- a/tests/RWLockReader.test.ts +++ b/tests/RWLockReader.test.ts @@ -484,4 +484,17 @@ describe(RWLockReader.name, () => { await g.next(); await lock.waitForUnlock(100); }); + test('release is idempotent', async () => { + const lock = new RWLockReader(); + let lockAcquire = lock.lock('read'); + let [lockRelease] = await lockAcquire(); + await lockRelease(); + await lockRelease(); + expect(lock.readerCount).toBe(0); + lockAcquire = lock.lock('write'); + [lockRelease] = await lockAcquire(); + await lockRelease(); + await lockRelease(); + expect(lock.writerCount).toBe(0); + }); }); diff --git a/tests/RWLockWriter.test.ts b/tests/RWLockWriter.test.ts index db1c4a2..68ee163 100644 --- a/tests/RWLockWriter.test.ts +++ b/tests/RWLockWriter.test.ts @@ -476,4 +476,17 @@ describe(RWLockWriter.name, () => { await g.next(); await lock.waitForUnlock(100); }); + test('release is idempotent', async () => { + const lock = new RWLockWriter(); + let lockAcquire = lock.lock('read'); + let [lockRelease] = await lockAcquire(); + await lockRelease(); + await lockRelease(); + expect(lock.readerCount).toBe(0); + lockAcquire = lock.lock('write'); + [lockRelease] = await lockAcquire(); + await lockRelease(); + await lockRelease(); + expect(lock.writerCount).toBe(0); + }); });