A wrapper around all threads used in this class. If a thread throws an exception, it will unblock the main thread and save the exception in a class variable. The main thread will then rethrow the exception before exiting. :param func: The start function for
(self, func)
| 435 | return os.WEXITSTATUS(exit_status) |
| 436 | |
| 437 | def _thread_wrapper(self, func): |
| 438 | """ |
| 439 | A wrapper around all threads used in this class. |
| 440 | |
| 441 | If a thread throws an exception, it will unblock the main |
| 442 | thread and save the exception in a class variable. The main |
| 443 | thread will then rethrow the exception before exiting. |
| 444 | |
| 445 | :param func: The start function for the thread |
| 446 | :type func: function |
| 447 | """ |
| 448 | try: |
| 449 | func() |
| 450 | except Exception as e: |
| 451 | self.exception = e |
| 452 | self.exit_event.set() |
| 453 | |
| 454 | def _start_threads(self): |
| 455 | """ |