Is deadlock possible in the following code snippet:
void f()
{
{
std::lock_guard <std::mutex> inner (lock1);
// do something
}
std::lock_guard <std::mutex> outer (lock2);
// do something
}
IOW, if multiple threads call this function, can a deadlock occur?
I am not too sure so any help would be highly appreciated.
Aucun commentaire:
Enregistrer un commentaire