1 /* Invoke pthread_detach() with an invalid thread ID. */
9 #if defined(VGO_freebsd)
10 #include <sys/types.h>
13 static void* thread_func(void* arg
)
18 int main(int argc
, char** argv
)
22 pthread_create(&thread
, NULL
, thread_func
, NULL
);
23 pthread_join(thread
, NULL
);
25 /* Invoke pthread_detach() with the thread ID of a joined thread. */
26 pthread_detach(thread
);
28 /* Invoke pthread_detach() with an invalid thread ID. */
30 pthread_detach((pthread_t
)12345);
32 pthread_detach((pthread_t
)((uintptr_t)thread
+ 8));
35 fprintf(stderr
, "Finished.\n");