I´m building a real time software where I have a main infinite loops on main() and threads used to read and process data.
main()
One of the issues is keeping a
You need to use something like
readerThreads.push_back(move(th));
This will make th an rvalue, and cause the move ctor to be called. The copy ctor of thread was disabled by design (see Anthony Williams' C++ Concurrency In Action).
th
thread