How to use named mutex at linux?

99封情书 提交于 2019-12-12 10:24:33

问题


I'd like to use named mutex at linux for multi process.

I searched at google and find some APIs. But, it's hard to break out the coding. I found two apis and it looks set name and be shared between processes.

pthread_mutexattr_setname_np
pthread_mutexattr_setpshared(&mtx_attr, PTHREAD_PROCESS_SHARED);

Could somebody give me hint or example?

来源:https://stackoverflow.com/questions/46313748/how-to-use-named-mutex-at-linux

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