richfitz / seagull

:bird: Portable file locking
https://richfitz.github.io/seagull
Other
2 stars 2 forks source link

Writing to the lockfile #1

Open richfitz opened 8 years ago

richfitz commented 8 years ago

Could be solved by use of a global counter and a bit of hackery, without having to create a full connection object.

On release we decrement the counter and if it hits zero:

  1. close the real file
  2. close the handle
  3. delete the global counter.