Code Room
Code reviewHard
Question
Review this C++ thread-safe queue.
What a strong answer looks like
Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix — specific and kind.
Learn the concepts
template <class T>class Queue { std::mutex m_; std::deque<T> q_;public: void push(T v) { m_.lock(); q_.push_back(std::move(v)); m_.unlock(); } T pop() { m_.lock(); T v = std::move(q_.front()); q_.pop_front(); return v; }};Run or narrate your approach, then ask the coach.