--- a/runtime/xenomai.py Fri Dec 06 11:45:03 2019 +0100
+++ b/runtime/xenomai.py Mon Dec 09 09:42:07 2019 +0100
@@ -7,6 +7,22 @@
from __future__ import absolute_import
from ctypes import CDLL, RTLD_GLOBAL, pointer, c_int, POINTER, c_char, create_string_buffer
+def installThreadCobaltHook(): + init_old = threading.Thread.__init__ + def init(self, *args, **kwargs): + init_old(self, *args, **kwargs) + def run_with_shadow(*args, **kw): + print("hello from thread"+repr(self)) + cobalt.cobalt_thread_harden() + self.run = run_with_shadow + threading.Thread.__init__ = init @@ -22,4 +38,6 @@
globals()[name] = CDLL("lib"+name+".so", mode=RTLD_GLOBAL)
cobalt.xenomai_init(pointer(c_int(0)), pointer((POINTER(c_char)*2)(create_string_buffer("prog_name"), None)))
+ # installThreadCobaltHook()