due only 8 hours
I attached the code template. And here are the full directions: A bank has a variable number of tellers who check-in to work by calling teller check in(). Customers enter the bank for service by calling do banking(). When there is an available teller, do banking() returns true and the customer gets service. If there is no available teller, do banking() blocks until a teller becomes available before returning true. When customers
nish getting service, they call finish banking() and leave the bank. Tellers may also check out (if they are not currently serving a customer) by calling teller check out(). On the course homepage you can
nd a code skeleton which creates teller and customer threads. Your task is to implement mutual exclusion for critical sections using phtread mutex and the correct synchronization using pthread condition variables. Note that in this program the tellers have to wait until a potential current customer has
nished doing banking before they can check out. Furthermore, do banking() returns the teller instead of true. Compile your program (with -lpthread) and test it. A correct program should run forever while incorrect programs might segfault or deadlock after a while.