Chinaunix首页 | 论坛 | 博客
  • 博客访问: 258589
  • 博文数量: 52
  • 博客积分: 1379
  • 博客等级: 大尉
  • 技术积分: 525
  • 用 户 组: 普通用户
  • 注册时间: 2006-06-18 17:34
文章分类

全部博文(52)

文章存档

2011年(48)

2010年(4)

分类: LINUX

2011-03-11 17:34:24

pthread_exit基本上就是设置好退出值,longjmp跳到

pthread_create

中的一段代码

  1. int not_first_call;
  2.   not_first_call = setjmp ((struct __jmp_buf_tag *) unwind_buf.cancel_jmp_buf);
  3.   可能会两次到这里来,一次是开始,一次是 _被_ 结束或者主动调用pthread_exit
  4.   否则只有一次,start_routine可能直接返回
  5.   if (! not_first_call)
  6.     {
  7.       /* Run the code the user provided. */
  8.          pd->start_routine (pd->arg));

  9.     }
  10. ....


阅读(1978) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~