Ticket seller problem using C++11 threads