That’s where I wonder if we’d get into implementation-specific trouble because it’s advisory on macOS and enforced on Windows.
Advisory locks allow cooperating processes to perform consistent operations on files, but do not guarantee consistency (i.e., processes may still access files without using advisory locks possibly resulting in inconsistencies).
So you are deliberately designing an uncooperatively designed locking protocol? This is a theory discussion - if you are worried about something incorrectly implemented, OK, but a correct implementation is not supposed to be a problem. What am I missing that worries you?I am worried that if I stick releaseLock in acquireLock, it will delete a second instance’s lock file.