]>
git.saurik.com Git - apple/libpthread.git/blob - tests/join.c
8 #define WAITTIME (100 * 1000)
14 printf("Join %lu\n", ++idx
);
32 res
= pthread_join(p
, NULL
);
38 __attribute((noreturn
))
48 res
= pthread_create(&p
, NULL
, thread
, param
);
51 res
= pthread_join(p
, &value
);
53 assert(param
== value
);
56 res
= pthread_create(&p
, NULL
, thread
, param
);
60 res
= pthread_join(p
, &value
);
62 assert(param
== value
);
65 res
= pthread_create_suspended_np(&p
, NULL
, thread
, param
);
67 kr
= thread_resume(pthread_mach_thread_np(p
));
70 res
= pthread_join(p
, &value
);
72 assert(param
== value
);
75 res
= pthread_create_suspended_np(&p
, NULL
, thread
, param
);
77 kr
= thread_resume(pthread_mach_thread_np(p
));
81 res
= pthread_join(p
, &value
);
83 assert(param
== value
);
86 param
= pthread_self();
87 res
= pthread_create_suspended_np(&p
, NULL
, thread1
, param
);
89 res
= pthread_detach(p
);
91 kr
= thread_resume(pthread_mach_thread_np(p
));