main()
{
...
int tid = startThread("thread1");
delay(0,5);
...
waitThread(tid); // !!!--->>> Output warning to logViewer: Invalid argument in function
// This understandable, after all, thread does not exist at this time.
...
}
void thread1()
{
}
Questions:
1. How i can squelch (suppress) the warning message after waitThread()?
or
2. How i can check existence of arbitrary thread, started in the script?
Currently there is no function to check for the existence of a thread.
Even if it would, since threads run "in parallel" there is no guarantee that the thread would still exist AFTER you called
some "threadExists" function.
What you probably can do in your script is using a semaphore.
Check the help at qthelp://wincc_oa/doc/ControlS_Z/Semaphorfunctions.htm
Even if it would, since threads run "in parallel" there is no guarantee that the thread would still exist AFTER you called
some "threadExists" function.
Yes, of course. I about this has not thought.
But, why warning message is issuing after waitThread()?
Because you tried an operation on a non existing thread.
This is probably a point for discussion. We could just store the error in the thread and not print it ...
Still I hope you find a solution e.g. with the semaphore.
We could just store the error in the thread and not print it
I hoped this. Generally, i don't see any error in this situation. I need to wait thread end only. If it already terminated, i expected continuation of normal execution of main thread.
Still I hope you find a solution e.g. with the semaphore.