首页 > 其他 > 详细

pthread_cleanup_push

时间:2018-01-22 22:15:01      阅读:242      评论:0      收藏:0      [点我收藏+]

#define pthread_cleanup_push(func, val) \

   { \

    struct __darwin_pthread_handler_rec __handler; \

    pthread_t __self = pthread_self(); \

    __handler.__routine = func; \

    __handler.__arg = val; \

    __handler.__next = __self->__cleanup_stack; \

    __self->__cleanup_stack = &__handler;

 

#define pthread_cleanup_pop(execute) \

    /* Note: ‘handler‘ must be in this same lexical context! */ \

    __self->__cleanup_stack = __handler.__next; \

    if (execute) (__handler.__routine)(__handler.__arg); \

   }

pthread_cleanup_push

原文:https://www.cnblogs.com/feng9exe/p/8331348.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!