lundi 5 janvier 2015

Is it possible to get a thread object for the main thread, and `join()` with it?

Is there a way to treat the main thread like any other thread with the C++11 (or later) facilities? Concretely, I am looking for is the ability to join() with the main thread. So, basically, I would like to do something like: main_thread.join(), but don't know how to obtain the main_thread object.


The thread constructors do not seem to offer any facilities based for instance on the thread id obtained with get_id(). The this_thread namespace offers also only minimal functionality, but misses for instance join(), which is what I am looking for.


Aucun commentaire:

Enregistrer un commentaire