Hi, everyone,
I am using loudmouth in an MFC application, in which I used the AfxBeginThread() to create a new thread for loudmouth, and my main thread doing the GUI work.
What should I do if I want to close the loudmouth thread in the main thread? I have got a rough search in the MSDN and found this:
It mainly tells that there are two ways to terminate a thread: First is the normal quit from the thread. The other one is called premature termination, which has to call the AfxEndThread() in the thread that would quit. So I can't use both methods, since the loudmouth thread is always in a g_main_loop_run() ...
I also noticed the sentence below in the upper URL:
"If you want to terminate a thread from another thread, you must set up a communication method between the two threads."
Maybe I can communicate with the LM thread with the GMainLoop structure?
Peter