cinetec_tech Posted September 11, 2014 Share Posted September 11, 2014 hi: I have a A.function1. A is a class. How could i run it's instance from a thread? i tried thread("A.function1"). but it doesn't work. thanks Link to comment
cinetec_tech Posted September 11, 2014 Author Share Posted September 11, 2014 it seems i can run thread in this way thread("function2",A). the function2 is a global function which call A.function1. but if i use "wait" keyword in the function, it will have an error Interpreter::runFunction(): depth of stack is not zero any idea how to use wait in a class? Link to comment
silent Posted September 12, 2014 Share Posted September 12, 2014 Hi, Assumig that you are trying to do something like that in a thread: class A { void heavy_func() { // process 1 wait; // process 2 wait; // process 3 wait; } }; A a = new A(); thread("heavy_func",a); Unfortunately, this code would not work. You can try to modify your code to look more like this: class A { void process1(); void process2(); void process3(); }; void heavy_func(A a) { a.process1(); wait; a.process2(); wait; a.process3(); wait; } A a = new A(); thread("heavy_func",a); Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Recommended Posts