HyugaPaolo

thread c

Jan 31st, 2018
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. Per compilare: gcc -Wall *nome.c -o nome -pthread
  2. Per eseguire : ./nome nome.c
  3. Per creare mutex: pthread_mutex_t nome = PTHREAD_MUTEX_INITIALIZER;
  4. lock: pthread_mutex_lock(&nome)
  5. unlock: pthread_mutex_unlock(&nome)
  6. pthread_exti(NULL)
  7. pthread_t nome;
  8. pthread_create(&tid_nome,NULL,nomemetodo,NULL)
  9.  
  10. #include <stdio.h>
  11. #include <stdlib.h>
  12. #include <unistd.h>
  13. #include <pthread.h>
Advertisement
Add Comment
Please, Sign In to add comment