Skip to content

Commit

Permalink
Apply workaround on MacroExecutor level proposed by mliszcz
Browse files Browse the repository at this point in the history
  • Loading branch information
reszelaz committed Dec 5, 2019
1 parent b7b4f09 commit 847785b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/sardana/macroserver/msmacromanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,20 @@

_BASE_DIR = os.path.dirname(os.path.abspath(__file__))

import cffi
ffibuilder = cffi.FFI()
ffibuilder.cdef("void* omni_thread_ensure_self();")
lib = ffibuilder.verify(r"""
#include <omnithread.h>
#include <cstdio>
void* omni_thread_ensure_self()
{
return new omni_thread::ensure_self;
}
""",
source_extension='.cpp',
libraries=["omnithread"]
)

def islambda(f):
"""inspect doesn't come with islambda so I create one :-P"""
Expand Down Expand Up @@ -1518,6 +1532,7 @@ def _jobEnded(self, *args, **kw):
self._stopped, self._aborted)

def __runXML(self):
es = lib.omni_thread_ensure_self()
self.sendState(Macro.Running)
try:
self.__runStatelessXML()
Expand Down

0 comments on commit 847785b

Please sign in to comment.