padlock
Advanced tools
Comparing version 1.1.0 to 1.1.2
{ | ||
"name": "padlock", | ||
"version": "1.1.0", | ||
"version": "1.1.2", | ||
"description": "Padlock works to prevent unexpected code execution when dealing with asynchronous callbacks without blocking. Call a function with lock to execute it as soon as a lock can be attained, and unlock it at all of your possible callback end-points. Use the same lock on other functions that you don't want to interrupt. Code will execute in order as the lock can be acquired.", | ||
@@ -5,0 +5,0 @@ "keywords": ["lock", "flow", "control", "flow-control", "acquire", "release", "synchronous", "asynchronous"], |
@@ -65,4 +65,4 @@ /** | ||
} | ||
this.lockid %= 65000; | ||
++this.lockid; | ||
this.lockid %= 65000; | ||
this.locked = true; | ||
@@ -74,3 +74,3 @@ var lastlocked = this.lockid; | ||
this.emit('timeout', this.lockid, callback, args); | ||
this.release() | ||
this.release(this.lockid) | ||
} | ||
@@ -136,4 +136,4 @@ }.bind(this), timeout); | ||
var timeout = callbackd[3]; | ||
this.lockid %= 65000; | ||
++this.lockid; | ||
this.lockid %= 65000; | ||
this.locked = true; | ||
@@ -140,0 +140,0 @@ var lastlocked = this.lockid; |
14889