#include <thread> on the top. Then you can create a thread like this:std::thread networkThread (networkCommunication);
networkThread.detach();To compile this program, you have to add two things to the compile command in the terminal:
-std=c++0x
-pthreadThe whole program is compiled like this:
g++ ./myProgram.c++ -o outputName -std=c++0x -pthreadNow you should be able to create threads on your Raspberry PI.
No comments:
Post a Comment