I have this code ,now can anyone reply s what happens to the lock in the following situation considering that cond is true:-
for (;;) {
static mutex m;
Lock lock(m);
if (cond)
break;
...
}
Thanks
I have this code ,now can anyone reply s what happens to the lock in the following situation considering that cond is true:-
for (;;) {
static mutex m;
Lock lock(m);
if (cond)
break;
...
}
Thanks
The RAII allows to unlock the mutex at the end of the scope.
here is another example Scooped Lock