Skip to content
Snippets Groups Projects
  1. Nov 18, 2024
    • Rob Swindell's avatar
      Simplify the fmutex_open() usage: always auto-remove when using open/close() · 1f37517c
      Rob Swindell authored
      The auto-remove param was only needed for fmutex(), which immediately closes
      (and thus don't want auto-removal), so create an internal function that's
      used by both fmutex() and fmutex_open().
      1f37517c
    • Rob Swindell's avatar
      Have fmutex_open()/close() accept a fmutex_t* argument · b7bd0331
      Rob Swindell authored
      This is needed for *nix where normal (i.e. not Samba-mount) file behavior
      requires that we manually unlink() the file, but not until just before closing
      it. So we have to keep track of the file name and the 'auto_remove' desire of
      the caller. This is not necessary when the file is on a Linux-smbfs, but we
      need to work as expected on normal/local *nix file systems too.
      
      This solves atomic lock file removal for *nix, but does not gaurantee lock file
      cleanup upon ungraceful process termination (e.g. crash). At least in this
      particular case, Windows beats UNIX.
      b7bd0331
    • Rob Swindell's avatar
      Revert "Use fmutex_open for 100% locking and auto-removal upon close/termination" · dbf5e775
      Rob Swindell authored
      This reverts commit e55183c0.
      
      fmutex_open()'s auto-remove feature doesn't work on normal/local Linux file
      systems: unlink() of a file immediately removes its directory entry allowing
      subsequent opens of the same file name, defeating the lock.
      
      I had tested fmutex_open() on a Samba mount (from Linux) and it worked as I
      wanted (like the Windows version does). Still searching for a good solution:
      if a process terminates, gracefully or not, I'd like the file to be removed
      at that time and until then, other processes or threads can't create or open
      the same lock file (using O_EXCL and file locking to insure this).
      dbf5e775
  2. Nov 17, 2024
  3. Nov 16, 2024
Loading