class MyClass : public WithMyClassLayout<TopWindow> { public: typedef MyClass CLASSNAME; MyClass(); void StartPlay(); //thread handling volatile Atomic terminated; volatile Atomic threads; }; typedef struct { MyClass *gui; } PlayInfo; //thread callback void WorkerThread(PlayInfo f) { while (true) { if(f.gui->terminated) break; //playfile } AtomicDec(f.gui->threads); } //Callback of button void MyClass::StartPlay() { PlayInfo f; f.gui = this; AtomicInc(threads); Thread().Run(callback1(WorkerThread, f));//error in this line }
Report message to a moderator