Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <pthread.h>
- using namespace std;
- void* print_message(void*) {
- cout << "Threading\n";
- }
- int main() {
- pthread_t t1;
- pthread_create(&t1, NULL, &print_message, NULL);
- cout << "Hello";
- // Optional.
- void* result;
- pthread_join(t1,&result);
- // :~
- return 0;
- }
- //g++ pthread.cpp -lpthread -o pthread
- //./pthread
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement