Bez popisu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

main-signal.c 337B

1234567891011121314151617181920
  1. #include <stdio.h>
  2. #include "mythreads.h"
  3. int done = 0;
  4. void* worker(void* arg) {
  5. printf("this should print first\n");
  6. done = 1;
  7. return NULL;
  8. }
  9. int main(int argc, char *argv[]) {
  10. pthread_t p;
  11. Pthread_create(&p, NULL, worker, NULL);
  12. while (done == 0)
  13. ;
  14. printf("this should print last\n");
  15. return 0;
  16. }