Home  >  Article  >  Backend Development  >  windows下面有类似sem_get函数可以用来互斥吗?解决办法

windows下面有类似sem_get函数可以用来互斥吗?解决办法

WBOY
WBOYOriginal
2016-06-13 10:18:08823browse

windows下面有类似sem_get函数可以用来互斥吗?
我在网上找了很多资料,都说用sem_get信号量可以用来互斥,但是发现sem_get只能在linux下使用。

win下有没有类似的函数模块啊?

或者有没有其他的方法来完成互斥?

------解决方案--------------------
用COM调用window的函数试试
------解决方案--------------------
这个貌似得自己写!
------解决方案--------------------
flock 查查用法
------解决方案--------------------
flock() 函数锁定或释放文件。

若成功,则返回 true。若失败,则返回 false。

把这茬给忘了!..

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn