On 12/03/2015 at 09:51, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R15
Platform: Windows ;
Language(s) : C++ ;
---------
Hi,
during the development of few plugins, I came to 2 very similar problems:
1. I have a C4DThread (lets call it thread A), which has to wait for some other work to be done by other thread (thread B). To do synchronization, I can simply use GeSignal and its Wait() method.
Now let say I want to interrupt thread A from somewhere else (e. g. from main thread). If I use TestBreak correcty in the implementation of thread A, it is simple. But I cannot check TestBreak during GeSignal::Wait() method (and the method is not interrupted by calling the Break() of thread its called from, at least it was not in the test plugin I made).
Is there some way to allow interruption during GeSignal::Wait() other than giving it a small timeout, checking TestBreak and repeating it?
2. Similar situation with GeSleep - I want to suspend the thread from its Main method for specific time, but I want to be abble to interrupt the thread even if its suspended. Is there a solution other than repeated calls to GeSleep with smaller times and checking TestBreak inbetween?
Thanks for any answer.