parent
eddcff455e
commit
10acaffde7
3 changed files with 32 additions and 0 deletions
@ -0,0 +1,7 @@ |
||||
project('threads', 'cpp') |
||||
|
||||
test('threadtest', |
||||
executable('threadprog', 'threadprog.cpp', |
||||
dependencies : dependency('threads') |
||||
) |
||||
) |
@ -0,0 +1,14 @@ |
||||
#include<thread> |
||||
#include<cstdio> |
||||
|
||||
void main_func() { |
||||
printf("Printing from a thread.\n"); |
||||
} |
||||
|
||||
int main(int, char**) { |
||||
printf("Starting thread.\n"); |
||||
std::thread th(main_func); |
||||
th.join(); |
||||
printf("Stopped thread.\n"); |
||||
return 0; |
||||
} |
Loading…
Reference in new issue