Simplified shutdown of queue.
Removed some debugging.
Added support for timed wait on semaphore.
Lock free queue.