added simple testThread.
added ugly consumer/producer.
fixed consumer to wait only if needed.

Note: the original was taken from Bjarne Stroustrup, if this fix is correct,
obviously the original example was not...