Fixed thread-safe queue template