There is no `race condition`, the spinlock ensures this.
The `thundering herd problem` is that when something happens, typically a lock being released or an I/O input event completing, lots of processes which have been waiting will resume. One will be choosen and all the rest will typically resume waiting on the lock or I/O event.
Think about a press conference. When the person giving the briefing finishes one answer all the reporters start trying to attract the attention of the briefer. The briefer chooses one, all the reporters settle down, a question is asked and answered, and then all the reporters try and attract the attention again. This works well with ten reporters but with ten thousand there is a lot of wasted effort of all the reporters trying to attract the attention that could be made more efficient by having a queue of reporters and each asking their question in turn.
So `thundering herd` is about efficiency rather than correctness.