>>The 10 is important, otherwise this statements blocks the execution
>Actually it just waits for the other thread to realease the lock, with no param you just wait forever.
That is correct. If you block forever, the next lines of code wouldn't make any sense.
>Oh, and another thing. Do you...
Ok, got it! The trick is to switch the statements (more or less):
// Ensure exclusive execution
CMutex *oMttx = new CMutex(FALSE, "MUTEST");
CSingleLock singleLock(oMttx, FALSE);
singleLock.Lock(10); // The 10 is important, otherwise this statements blocks the execution, until...
The question is simple: Why doesn't show up a message box? The operation ("do") startet in MyControllingFunction is lengthy. So all new threads are started in parallel. The mutexes are created in different threads, but should all refer to the same kernel object.
What point am I missing...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.