karimsa/rsxjs

Mutex unlocks should only be allowed to be called once

Opened this issue · 0 comments

Description

Currently, Mutexes, Semaphores, & RWMutexes will return an unlock callback which

Steps to Reproduce (for bugs)

  1. Lock a semaphoer & store its callback function.
  2. Lock a semaphore in a separate process & store its callback function.
  3. In process P1, call the unlock function twice.

Expected: The second call should either fail or do nothing.
Current: The lock will be unlocked for the second process.

Your Environment (for bugs)

  • Package version (exact): 0.5.2
  • Operating system: any
  • Node.js version: 6.x.x
  • npm version: 6.x.x