No, this is not true. You are almost there, but the big problem is that the Multiply and Increment functions should use the same mutex.
A mutex is an object that provides MUTual EXclusion. In other words, the point of a mutex is to prevent two threads from simultaneously touching the same variable and getting unpredictable results. A mutex is like a token that has one stream at a time, which gives it the right to access a specific variable (or set of variables). In this case, the variable you are trying to protect is counter . There should be one and only one mutex that controls access to counter . In your case, each stream will contain its own token, which, in its opinion, gives it the right to access the counter, and therefore there will be unpredictable behavior.
You hold the mutex by blocking it. This is the point of locks, and why you cannot "escape" them. The whole point of locked locks is that provided that you only have one mutex m , when one of the threads holds the lock on m , the other thread is also guaranteed not to hold the lock on m . If you encoded correctly, committing to m should be a prerequisite for accessing counter , so the value of counter should be predictable.
Now, in relation to wait() . Calling wait() means "I refuse to lock this mutex until someone else signals this state, and then I want to return it." At the same time, the flow stops. Suppose you have only one mutex m and condition c , and lk is a lock on m , the line c.wait(lk) means that the thread will refuse to lock lk on m and then pause execution until some other thread will not call c.notify_one() (or c.notify_all() ). When the waiting thread returns from the call to wait() , it will automatically restart the lk lock on m , and therefore it is allowed to access counter again.
Finally, these locks are “copied” locks. This means that they are automatically released upon destruction (when they go beyond). Thus, in this case, each function retains its lock until it exits, unless it abandoned its lock to wait and paused while waiting for a signal.