def main(): california_warehouse = WareHouse("California") california_warehouse.increment("APP", 500) california_warehouse.increment("ORG", 200) newyork_warehouse = WareHouse("NewYork") newyork_warehouse.increment("APP", 1200) newyork_warehouse.increment("ORG", 700) cairo_warehouse = WareHouse("Cairo") cairo_warehouse.increment("APP", 1500) cairo_warehouse.increment("ORG", 1000) john_seller = Seller("John") john_seller.add_warehouse(california_warehouse) john_seller.add_warehouse(newyork_warehouse) john_seller.add_warehouse(cairo_warehouse) global threadLock threadLock = threading.Lock() threads = [] # Create new threads thread1 = myThread(1, "Thread-1", 1, seller=john_seller) thread2 = myThread(2, "Thread-2", 2, seller=john_seller) thread3 = myThread(3, "Thread-3", 3, seller=john_seller) thread4 = myThread(4, "Thread-4", 4, seller=john_seller) thread5 = myThread(5, "Thread-5", 5, seller=john_seller) thread6 = myThread(6, "Thread-6", 6, seller=john_seller) thread7 = myThread(7, "Thread-7", 7, seller=john_seller) thread8 = myThread(8, "Thread-8", 8, seller=john_seller) thread9 = myThread(9, "Thread-9", 9, seller=john_seller) thread10 = myThread(10, "Thread-10", 10, seller=john_seller) # Start new Threads thread1.start() thread2.start() thread3.start() thread4.start() thread5.start() thread6.start() thread7.start() thread8.start() thread9.start() thread10.start() # Add threads to thread list threads.append(thread1) threads.append(thread2) threads.append(thread3) threads.append(thread4) threads.append(thread5) threads.append(thread6) threads.append(thread7) threads.append(thread8) threads.append(thread9) threads.append(thread10) # Wait for all threads to complete for t in threads: t.join() print("Exiting Main Thread") print_seller_info(john_seller)