Added threadsafe queue example

Threadsafe queue example generalises previous example on condition
variable using. Now user code looks much simpler.