()
| 23 | ################################################################################ |
| 24 | |
| 25 | def main(): |
| 26 | parse_argv() |
| 27 | run_flag, buffer_queue, producer_stack, consumer_stack, print_queue = [True], Queue(argv[1]), Stack(), Stack(), Queue() |
| 28 | producer_thread = Thread(target=producer, args=(run_flag, argv[3], buffer_queue, producer_stack, print_queue)) |
| 29 | consumer_thread = Thread(target=consumer, args=(run_flag, producer_thread, buffer_queue, consumer_stack, argv[4], print_queue)) |
| 30 | printer_thread = Thread(target=printer, args=(run_flag, consumer_thread, print_queue)) |
| 31 | producer_thread.start() |
| 32 | consumer_thread.start() |
| 33 | printer_thread.start() |
| 34 | sleep(argv[2]) |
| 35 | run_flag[0] = False |
| 36 | printer_thread.join() |
| 37 | check_results(producer_stack , consumer_stack) |
| 38 | |
| 39 | def parse_argv(): |
| 40 | try: |
no test coverage detected