From ba94ab770257806fb6a61fe5260484b56e2fe41e Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Wed, 2 May 2012 15:50:52 -0700 Subject: [PATCH] userprog: print current thread ID --- userprog.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/userprog.c b/userprog.c index 2847c1af..ba0c867f 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()); } -- 2.34.1