Mono alternative for named Mutex

断了今生、忘了曾经 提交于 2019-12-04 05:42:56

UPDATE:
Try to look at http://aakinshin.net/en/blog/dotnet/namedmutex-on-mono/

OLD:
Mono does not support any Windows-native IPC. So you do not have for example Named Pipes, or Mutexes.

But to sync threads in the same process you can use Monitor class explicitly (it also used for lock).

To simply notify another process you can try to use Unix Domain Sockets.
Check UnixEndPoint class for that. One of benefits you can specify name for it (like for named semaphore for example).

Also you can try to emulate Mutex using own file. Try to get exclusive access to specific own file. While you have that access - you are in critical section.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!