Skip to content
Snippets Groups Projects
Commit a3eb5dd6 authored by Erik Strand's avatar Erik Strand
Browse files

Add simplest possible std::thread example

parent ead9ca2c
Branches
No related tags found
No related merge requests found
# This Makefile compiles and flashes four different programs:
CPPFLAGS=-Wall -O3 -pthread
%: %.cpp
g++ $(CPPFLAGS) -o build/$@ $<
#include <thread>
#include <iostream>
void thread_method() {
std::cout << "hello thread" << std::endl;
}
int main() {
std::thread thread(thread_method);
thread.join();
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment