1 /* Simple test code with no bug */
3 #include "src/sthread/sthread.h"
8 static void* thread_fun(void* ignore)
10 sthread_mutex_lock(&mutex);
11 sthread_mutex_unlock(&mutex);
16 int main(int argc, char* argv[])
18 sthread_mutex_init(&mutex, NULL);
22 sthread_create(&thread1, NULL, thread_fun, NULL);
23 sthread_create(&thread2, NULL, thread_fun, NULL);
24 sthread_join(thread1, NULL);
25 sthread_join(thread2, NULL);
27 sthread_mutex_destroy(&mutex);
29 fprintf(stderr, "done\n");