Aodai

thread

Nov 25th, 2020
320
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data