add thread safe ring queue.