开发者

running main thread frm another thread

开发者 https://www.devze.com 2023-04-08 06:26 出处:网络
I have run a secondary thread which some operations are carried on. Then while executing in secondary thread i want to call some operations on main thread. Can any one have sample code for it. I could

I have run a secondary thread which some operations are carried on. Then while executing in secondary thread i want to call some operations on main thread. Can any one have sample code for it. I could not find it from google.

Here is my sample call:

Glib::thread_init();
Glib::Thread *const myThread = Glib::Thread::create(sigc::mem_fun(*this, &MyClass::MyFunction), true);
myThread->开发者_开发百科join();
MyClass::MyFunction()
{

  //here i want to call the function from main thread
  AnotherFunction();   
}

MyClass::AnotherFunction()
{

}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号