Advertisement
Aodai

thread

Nov 25th, 2020
433
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.26 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <pthread.h>
  3.  
  4. void* greet(void* args) {
  5.     printf("Hello from the thread!");
  6.     pthread_exit(0);
  7. }
  8.  
  9. int main() {
  10.     pthread_t thrd;
  11.     pthread_create(&thrd, NULL, greet, NULL);
  12.     pthread_join(thrd, NULL);
  13.     return 0;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement