So, basically, the goal here is to link to boost_thread. I'm going to assume you've already gotten libboost-all from the repositories.
- Right click on the project you want to do threading in.
- C/C++ Build > Settings > Tool Settings > GCC C++ Linker > Libraries.
- In the top panel, add an entry for "boost_thread"
Just for fun, here's the code for basic threading:
// Start the thread
boost::thread workerThread(doWork);
// Pause this thread until workerThread is done
workerThread.join();
Note that we don't really need to "join" the thread. workerThread will go off and do it's own thing, even if we do our own.
Happy threading!
Happy threading!
No comments:
Post a Comment