void arr_cust() { create("arr_cust"); line.reserve(); // join the line and wait to be head vendingMachineRequested.set(); // i am the front of the line waitVendingMachineOpen.queue(); // wait for an open machine vendingMachineRequested.clear(); // vending machine is open and im taking it clear for next in line vendingMachineIsOpen.set(); // tell vending machine that i am about to use it. line.release(); // i am not the head of the line anymore pass it to next in line. doneWithMachine.wait(); // I am done after time to use machine is free and im leaving and dying. // set up shuttle process }