From: Brian Norris Date: Wed, 2 May 2012 22:50:52 +0000 (-0700) Subject: userprog: print current thread ID X-Git-Tag: pldi2013~471 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ba94ab770257806fb6a61fe5260484b56e2fe41e;p=model-checker.git userprog: print current thread ID --- diff --git a/userprog.c b/userprog.c index 2847c1a..ba0c867 100644 --- a/userprog.c +++ b/userprog.c @@ -30,11 +30,11 @@ void user_main() atomic_init(&obj, 0); - printf("Creating 2 threads\n"); + printf("Thread %d: creating 2 threads\n", thrd_current()); thrd_create(&t1, (thrd_start_t)&a, &obj); thrd_create(&t2, (thrd_start_t)&a, &obj); thrd_join(t1); thrd_join(t2); - printf("Thread is finished\n"); + printf("Thread %d is finished\n", thrd_current()); }