MCPcopy Create free account
hub / github.com/apache/mesos / _thread_wrapper

Method _thread_wrapper

src/python/cli_new/lib/cli/mesos.py:437–452  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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 """

Callers

nothing calls this directly

Calls 1

setMethod · 0.45

Tested by

no test coverage detected