Is it possible to bypass a file lock in C# when another thread/process is unecessarily using an exclusive lock?

前端 未结 7 1111
半阙折子戏
半阙折子戏 2021-01-11 12:07

Is there a way to bypass or remove the file lock held by another thread without killing the thread?

I am using a third-party library in my app that is performing

7条回答
  •  余生分开走
    2021-01-11 12:54

    If the file is locked and isn't being used, then you have a problem with the way your file locking/unlocking mechanism works. You should only lock a file when you are modifying it, and should then immediately unlock it to avoid situations like this.

提交回复
热议问题