mercredi 8 mars 2017

How to use c++11 std::thread to implement QThread?

std::thread is not simply inheritable by classes, cannot auto join when destruction, etc.

Lots of pitfalls like need to use std::atomic_bool for stopping, cannot simply share this of object when use std::thread as member variables to execute a member method.

Is there any good practice to implement QThread like classes using std::thread?

Aucun commentaire:

Enregistrer un commentaire