Creating a Thread using boot library - C++ boost

C++ examples for boost:thread

Description

Creating a Thread using boot library

#include <iostream>

#include <boost/thread/thread.hpp>
#include <boost/thread/xtime.hpp>

struct MyThreadFunc {
   void operator()() {
   }
} threadFun;

int main() {

   boost::thread myThread(threadFun); 

   boost::thread::yield(); 

   myThread.join(); 
}

Related Tutorials