Templatize synchronized_queue.