two threads are created if i use the following:
void func()
{}
std::thread td1;//thread object created.
...
...
//defer the running of td1 until now
td1 = std::thread(func);//temp thread object(rvalue) created
Is there a way to achieve the defer execution but without creating two threads?
Aucun commentaire:
Enregistrer un commentaire