 <p>I assume, the question reflects an attemtpt to use unique_lock, which OP is saying works. The same example with lock_guard would not work, since <code>std::vector::emplace_back</code> requires the type to be both <code>MoveInsertable</code> and <code>EmplaceConstructible</code>, and <code>std::lock_guard</code> does not suit.</p>