I understand the concept of thread safety is to prevent data races and other undefined behavior. However, when using mutexes and thread locks (say C++'s std::mutex and std::scoped_lock for example), say I have a thread-safe network message queue and need to lock it in order to pop a message. If another message arrives during that lock period, is it waiting in line so to speak, or is it utterly ignored and thus the queue cannot accept incoming data during a lock period? I'm very concerned about possible data loss.