metasync icon indicating copy to clipboard operation
metasync copied to clipboard

Implement TimedMutex

Open tshemsedinov opened this issue 5 years ago • 0 comments

TimedMutex allow us to lock shared resource for an interval less then timeout

class TimedMutex {
  status: SM_UNLOCKED | SM_LOCKED,
  constructor(timeout),
  timeout: <number>,
  async enter(callback), // if no callback passed Promise will be returned
  leave()
}

tshemsedinov avatar Mar 16 '19 13:03 tshemsedinov