mardi 2 juillet 2019

Does std::condition_variable::wait_until have any advantage against std::this_thread::sleep_for?

In a time waiting scenario, I wanted to use

std::this_thread::sleep_for

But my superior strongly against any form of sleep function. He recommends

std::condition_variable::wait_until(lock, timeout-time, pred)

I wonder if there are any disadvantage for sleep_for under such scenario?

Aucun commentaire:

Enregistrer un commentaire