bounded-buffer solution with one buffer