Producer/Consumer with a bounded buffer. From the linuxthreads demos.