1 /* Simple test code with no bug */
8 static void* thread_fun(void* ignore)
10 pthread_mutex_lock(&mutex);
11 pthread_mutex_unlock(&mutex);
16 int main(int argc, char* argv[])
18 fprintf(stderr, "User main is starting\n");
20 pthread_mutex_init(&mutex, NULL);
24 pthread_create(&thread1, NULL, thread_fun, NULL);
25 fprintf(stderr, "here\n");
26 pthread_create(&thread2, NULL, thread_fun, NULL);
27 fprintf(stderr, "there\n");
28 pthread_join(thread1, NULL);
29 pthread_join(thread2, NULL);
31 fprintf(stderr, "User main is done\n");