A factory makes glass bottles.
A customer can place an order for either 10 transparent or 10 painted bottles.
There are glass blowers, painters and packers in the factory.
As long as an order is not placed, no glass is blown.
As long as a bottle is not blown, no bottle is painted.
If the order is for transparent bottles, the painter does not work, and the bottles are passed to the packer.
If the order is for painted bottles, the painter paints them and passes them on to the packer.
The packer does not work as long as he does not receive bottles. The packer places 10 bottles in a crate, after which he tells the customer that the order is ready.
The customer must not try to pick the order before it is ready.
A new customer must not place order before the previous one picks his order.
Insert necessary synchronization and mutual exclusion with semaphores in the given code. Do not forget to initialize them. You may use if-else structures. If you use them, place opening and closing brackets for them correctly.