暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

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. }