Guest User

Untitled

a guest
Feb 20th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. void quicksort (quickarg qa) {
  2. pthread_t thread1, thread2;
  3. int pivot = qa.premier;
  4. int dernier = qa.dernier;
  5. int ret;
  6.  
  7. if (qa.premier < qa.dernier) {
  8. pivot = quicksort_partitionner(qa.tab, qa.premier, qa.dernier, pivot);
  9.  
  10. qa.dernier = pivot - 1;
  11. pthread_create (&thread1, NULL, (void *) &quicksort, (void *) &qa);
  12. qa.premier = pivot + 1;
  13. qa.dernier = dernier;
  14. pthread_create (&thread2, NULL, (void *) &quicksort, (void *) &qa);
  15.  
  16. pthread_join(thread1, NULL);
  17. pthread_join(thread2, NULL);
  18. }
  19. }
Add Comment
Please, Sign In to add comment