10 pymxs.runtime.Teapot()
16 def callMXSEntryEx1(locker, tick, evt):
22 with pymxs.mxstoken():
23 pymxs.runtime.Teapot(Name=
"callMXSEntryEx1")
26 if not evt.wait(tick):
27 pymxs.print_(
"Error: event untiggered\nwhich indicates 'with block' in Ex2 haven't finished\n",
True,
True)
30 pymxs.print_(
"Error: unexpected exception\n",
True,
True)
36 def callMXSEntryEx2(locker, tick, evt):
49 with pymxs.mxstoken():
51 pymxs.runtime.Teapot(Name=
"callMXSEntryEx2")
53 pymxs.print_(
"Error: expected counter 30, got %d\nwhich indicates 'with block' in Ex2 haven't finished\n" % counter,
True,
True)
59 pymxs.print_(
"succss",
False,
True)
62 locker = threading.Lock()
63 evt = threading.Event()
64 t1 = threading.Thread(target=callMXSEntry)
65 t2 = threading.Thread(target=callMXSEntryEx1, args=(locker, 1, evt))
66 t3 = threading.Thread(target=callMXSEntryEx2, args=(locker, 0.01, evt))
71 if __name__ ==
"__main__":