-
Notifications
You must be signed in to change notification settings - Fork 59
Description
Hello! I'm writing a plugin for Sketch, and inside the cocoa script I use performSelectorInBackground_withObject to start a new thread and don't block the execution of a log running process. that works perfect!
I call coscript.setShouldKeepAround(true); and coscript.setShouldKeepAround(false); when the thread ends. that works ok.
the problem is that, if I start (lets say) 3 scripts, different names, different COScript instances, this happens:
- thread A works
- when thread B starts, 'B' takes all work and A stops/waits
- when C starts and B waits and C starts and finish
- then B continue and finish
- then A finish
so for some reason it seems something is making them stop/wait when other thread is working.
I know COScript does not really support threads, but they work... in some way... the question is, why this could be happening? I tried many things, but in all cases this happens. if someone has any tip I can work over that, but I just don't know what else to try... thx!
TIA!