Since you did not provide any code, we can just guess!
Well, you will most likely have some "cart pool" - like a central line waiting to be assigned to a cashier. Since multiple lanes can become "free" simultaneously you need to take care about tread-safety.
Threadsafety is easy, just create a central std::mutex and wrap the dequeue routine and empty central-lane checks in a {} scope that contains a std::scoped_lock(your_global_mutex).
Now, what happens when there is currently no cart waiting in the central line? Then all cashier threads must wait() until the central line notify()es about new carts being available. For that to work you must lock the cashier threads:
You will need a condition variable and a mutex. Waiting goes like this and should be performed whenever one of those threads detects that the cart line is empty [but outside of the scoped lock]!
std::unique_lock<std::mutex> lk(your_condition_variable_mutex);
your_condition_variable.wait(lk, []{return i == 1;});
Make sure you have a global variable
int i = 0;
or something along the lines, because wait() can wake up sometimes for no reason - without the notify call().
Now, everytime you add a new cart to the main line, you set i=1 and call notiftAll() on your condition variable! (remember to set it back to 0 at the correct time - f.ex. shortly before taking out the last cart from the central line and guarded by the scoped_lock of the global mutex for example)