lundi 5 septembre 2016

scope of std::lock_guard inside if block

Currently studying about std::mutex and would love some help. If I've a code that looks like -

....
if(returnBoolValue())
{
    std::lock_guard<std::mutex> lock(mutex_var);
    ....
    ....
}
....

is the std::lock_guard guarding the function returning the value inside if condition? ie. returnBoolValue()

And how should I prove it, if possible?


Aucun commentaire:

Enregistrer un commentaire