Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

This is an offshoot of thisthis question but with a few constraints removed.

I have a system where I need to manage file locking. I need to be able to lock a file (shared read locking) in one thread and then unlock it in another. More accurately, I can't be sure what thread it will be unlocked in or even if the creating thread is still around.

I will also need exclusive write locking to go with this but that will be all in the same thread.

the .NET Mutex won't work as it does extra stuff when the creating thread exits

This is an offshoot of this question but with a few constraints removed.

I have a system where I need to manage file locking. I need to be able to lock a file (shared read locking) in one thread and then unlock it in another. More accurately, I can't be sure what thread it will be unlocked in or even if the creating thread is still around.

I will also need exclusive write locking to go with this but that will be all in the same thread.

the .NET Mutex won't work as it does extra stuff when the creating thread exits

This is an offshoot of this question but with a few constraints removed.

I have a system where I need to manage file locking. I need to be able to lock a file (shared read locking) in one thread and then unlock it in another. More accurately, I can't be sure what thread it will be unlocked in or even if the creating thread is still around.

I will also need exclusive write locking to go with this but that will be all in the same thread.

the .NET Mutex won't work as it does extra stuff when the creating thread exits

added 123 characters in body
Source Link
BCS
  • 79.2k
  • 71
  • 197
  • 300

This is an offshoot of this question but with a few constraints removed.

I have a system where I need to manage file locking. I need to be able to lock a file (shared read locking) in one thread and then unlock it in another. More accurately, I can't be sure what thread it will be unlocked in or even if the creating thread is still around.

I will also need exclusive write locking to go with this but that will be all in the same thread.

the .NET Mutex won't work as it does extra stuff when the creating thread exits

This is an offshoot of this question but with a few constraints removed.

I have a system where I need to manage file locking. I need to be able to lock a file in one thread and then unlock it in another. More accurately, I can't be sure what thread it will be unlocked in or even if the creating thread is still around.

the .NET Mutex won't work as it does extra stuff when the creating thread exits

This is an offshoot of this question but with a few constraints removed.

I have a system where I need to manage file locking. I need to be able to lock a file (shared read locking) in one thread and then unlock it in another. More accurately, I can't be sure what thread it will be unlocked in or even if the creating thread is still around.

I will also need exclusive write locking to go with this but that will be all in the same thread.

the .NET Mutex won't work as it does extra stuff when the creating thread exits

Source Link
BCS
  • 79.2k
  • 71
  • 197
  • 300

Non threadlocked Mutex

This is an offshoot of this question but with a few constraints removed.

I have a system where I need to manage file locking. I need to be able to lock a file in one thread and then unlock it in another. More accurately, I can't be sure what thread it will be unlocked in or even if the creating thread is still around.

the .NET Mutex won't work as it does extra stuff when the creating thread exits