|
Mutex就两种类型:
local mutexes, which are unnamed, and named system mutexes
见 http://msdn.microsoft.com/en-us/ ... hreading.mutex.aspx
前者存在于一个进程中,后者可以多进程间竞争。
而楼主给的明显属于前者。加上static仅仅是实现线程安全一个措施而已,根本不是什么进程锁。
对于CMutex Class:
the name of the mutex (if it will be used across process boundaries),
对于CMutex::CMutex
lpszName Name of the CMutex object. If another mutex with the same name exists, lpszName must be supplied if the object will be used across process boundaries. ...
MSDN写的非常明确。很诧异楼主查阅MSDN为何仍然得出这是进程锁的说法?
[ 本帖最后由 shanxi 于 2009-9-11 12:17 编辑 ] |
|