This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Question on pthread_cancel/pthread_exit and thread stack unwind


Hi Yufeng,

Refrain from using pthread_cancel and pthread_exit. Those are Big Hammers and Sharp Knives.

Instead, set a variable that is monitored by the thread and set by the owner-thread / main thread which signals the child thread to terminate gracefully.

Mutex / condvar yada yada yada like normal apply.

HTH,
--Eljay


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]