Commit 80356736 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov

test: Make pthreads to report data

Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@gmail.com>
parent 750be421
......@@ -27,7 +27,7 @@ static void *f1(void *arg)
pthread_mutex_lock(&mtx);
counter++;
/* printf("Counter value: %d\n", counter); */
printf("%d: Counter value: %d\n", getpid(), counter);
pthread_mutex_unlock(&mtx);
sleep(2);
......@@ -44,8 +44,8 @@ static void *f2(void *arg)
while (1) {
pthread_mutex_lock(&mtx);
counter++;
/* printf("Counter value: %d\n", counter); */
counter--;
printf("%d: Counter value: %d\n", getpid(), counter);
pthread_mutex_unlock(&mtx);
sleep(3);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment