我正在研究一个多线程项目,我需要在代码中的某个位置复制一个线程的堆栈(我需要一个指向它的指针).因为在退出这个线程后我将需要该指针(并且它的堆栈被释放).如果我能以某种方式告诉pthread_exit()不要释放线程堆栈,它也可以完成这项工作!
pthread_exit()
PS:这背后的原因是我希望setcontext(ucontext_t*)稍后在这个线程实际死亡时使用.
setcontext(ucontext_t*)
c linux stack multithreading pthread-exit
c ×1
linux ×1
multithreading ×1
pthread-exit ×1
stack ×1