Terminating Threads in VC++

Status
Not open for further replies.

Almor

Newbie level 1
Joined
Aug 23, 2006
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,286
Can anybody help me to understand How terminate a worker thread created with AfxBeginThread(..) function in MFC application.
I mean to terminate worker thread from original thread.

Thank you for advance.
 

From within the thread, call AfxEndThread() or simply return from the worker thread start function.

To properly terminate a thread from another thread, you must signal or otherwise communicate to the thread that you want it to terminate and then it should terminate itself. Use one of the many multithreading techniques for signaling or data sharing/locking.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…