Implemented a thread-safe request queue.