# HG changeset patch # User Edouard Tisserant # Date 1528104128 -7200 # Node ID 983c482f8e4280016bfd8fb0d7d73f8e0f2c221a # Parent 64268e87613e8a331b577221f19a0f8c336b2b01 Commented out safety check to prevent deadlock in wxEvaluator, since wx Mainloop is not anymore in main thread. That safety check actually leads to having wx code running outside of MainLoop diff -r 64268e87613e -r 983c482f8e42 Beremiz_service.py --- a/Beremiz_service.py Wed May 23 10:53:57 2018 +0200 +++ b/Beremiz_service.py Mon Jun 04 11:22:08 2018 +0200 @@ -510,7 +510,7 @@ if havewx: wx_eval_lock = Semaphore(0) - main_thread = currentThread() + # main_thread = currentThread() def statuschangeTskBar(status): wx.CallAfter(taskbar_instance.UpdateIcon, status) @@ -523,14 +523,14 @@ wx_eval_lock.release() def evaluator(tocall, *args, **kwargs): - if main_thread == currentThread(): - # avoid dead lock if called from the wx mainloop - return default_evaluator(tocall, *args, **kwargs) - else: - o = type('', (object,), dict(call=(tocall, args, kwargs), res=None)) - wx.CallAfter(wx_evaluator, o) - wx_eval_lock.acquire() - return o.res + # if main_thread == currentThread(): + # # avoid dead lock if called from the wx mainloop + # return default_evaluator(tocall, *args, **kwargs) + # else: + o = type('', (object,), dict(call=(tocall, args, kwargs), res=None)) + wx.CallAfter(wx_evaluator, o) + wx_eval_lock.acquire() + return o.res pyroserver = Server(servicename, given_ip, port, WorkingDir, argv,