Changed shared_queue implementation