Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rwlock

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rwlock - npm Package Compare versions

Comparing version 1.0.1 to 2.0.0

2

package.json
{
"name": "rwlock",
"version": "1.0.1",
"version": "2.0.0",
"description": "Read-write lock implementation for Node.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -5,1 +5,6 @@ ReadWriteLock

Read-write lock for Node.
License
=======
This Node module is released under the MIT License.

@@ -1,4 +0,5 @@

/*! ReadWriteLock.js - v1.0.0 - 2013-02-14
/*! ReadWriteLock.js - v2.0.0 - 2013-02-15
* Part of the Canvace technology <http://www.canvace.com/>
* Released under the MIT License
* Copyright (c) 2013 Canvace Srl */
module.exports=function(){"use strict";function n(e,n){var r=function(){var n=!1;return function(){n||(n=!0,t[e].readers--,t[e].queue.length?t[e].queue[0]():delete t[e])}}();e in t?t[e].readers<0||t[e].queue.length?t[e].queue.push(function(){t[e].readers>=0&&(t[e].queue.shift(),t[e].readers++,n(r),t[e].queue.length&&t[e].queue[0]())}):t[e].readers++:(t[e]={readers:1,queue:[]},n(r))}function r(e,n){var r=function(){var n=!1;return function(){n||(n=!0,t[e].readers=0,t[e].queue.length?t[e].queue[0]():delete t[e])}}();e in t?t[e].readers||t[e].queue.length?t[e].queue.push(function(){t[e].readers||(t[e].queue.shift(),t[e].readers=-1,n(r))}):(t[e].readers=-1,n(r)):(t[e]={readers:-1,queue:[]},n(r))}var t={};this.readLock=n,this.writeLock=r,this.criticalSection=function(e,t,n){r(e,function(e){t(),e()},n)}};
module.exports=function(){"use strict";function n(e,n){var r=function(){var n=!1;return function(){n||(n=!0,t[e].readers--,t[e].queue.length?t[e].queue[0]():delete t[e])}}();e in t?t[e].readers<0||t[e].queue.length?t[e].queue.push(function(){t[e].readers>=0&&(t[e].queue.shift(),t[e].readers++,n(r),t[e].queue.length&&t[e].queue[0]())}):t[e].readers++:(t[e]={readers:1,queue:[]},n(r))}function r(e,n){var r=function(){var n=!1;return function(){n||(n=!0,t[e].readers=0,t[e].queue.length?t[e].queue[0]():delete t[e])}}();e in t?t[e].readers||t[e].queue.length?t[e].queue.push(function(){t[e].readers||(t[e].queue.shift(),t[e].readers=-1,n(r))}):(t[e].readers=-1,n(r)):(t[e]={readers:-1,queue:[]},n(r))}var t={};this.readLock=n,this.writeLock=r,this.readSection=function(e,t,r){n(e,function(e){t(),e()},r)},this.writeSection=function(e,t,n){r(e,function(e){t(),e()},n)}};
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc