thread programming problem

Hello there. I am new in thread programming. Who has ever tried the barrier
programming example “barrier1.c” on pages 51+52 in the “getting started”
book? After compiling and executing, the output is not as expected:

After all three barrier_waits occured, just thread2()'s printf is printed.
The printf of main() is clipped and the output of thread1() does not appear
at all.

How can this be? Where has the printf output go?

Nnamdi