the functions exists()/click()... freezes within a thread
OS and sikuliX version :
1.
Hi there. First, thanks for the hard work on sikulix!
My question :
I'm running a Sikulix code in an independent Thread implemented using java.land.Thread.
While this thread is running, a region is under observation looking for a pattern to appear. When the pattern show-up, a handler is called with the Thread reference as a second parameter (after event).
This handler should suspend this thread and after doing some work resume it. Within this work there is an (lambda instruction) event.region.
Sometimes the pattern show up while the thread is running a find/exists operation, and this causes (lambda instruction) to freeze.
#######
Here is a sketch of the code:
def P1Appreared(
global var
someThread.
event.
#do some work involving var
...
if var :
else:
event.repeat()
def task1():
#some instructions
.....
if R2.exists(someP):
someLocat
waitVanis
.....
else:
....
def aFunction():
#some instructions
myThread = Thread(task1)
R1.
R1.
myThread.
myThread.
aFunction()
#######
And i can't avoid using threads because i need the handler to stop/resume the task, otherwise a conflict in using keybord/mouse happens.
Thanks again!
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- majdoub
- Solved:
- Last query:
- Last reply: