You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On windows, we can use LockFileEx in async mode and possibly combine that with cancelioex to cancel the async io operation (not sure if this works). Also since we're doing async IO it's probably not the end of the world to just leave the async task running and have it unlock itself upon completion.
Activity
c0shea commentedon Sep 29, 2020
Fun with file locking
madelson commentedon Sep 29, 2020
@c0shea feel free to check out the new implementation here: https://github.com/madelson/DistributedLock/blob/release-2.0/DistributedLock.FileSystem/FileDistributedLock.cs#L66. It's a similar idea to what you've linked. If you're interested in trying this out I can publish a prerelease. Otherwise, this will come out with 2.0.