提交 e3234d01 编写于 作者: R Rich Felker

fix pthread_cleanup_pop(1) crash in non-thread-capable, static-linked programs

上级 aab33ec0
...@@ -5,6 +5,8 @@ void __do_cleanup_pop(); ...@@ -5,6 +5,8 @@ void __do_cleanup_pop();
void _pthread_cleanup_push(struct __ptcb *cb, void (*f)(void *), void *x) void _pthread_cleanup_push(struct __ptcb *cb, void (*f)(void *), void *x)
{ {
cb->__f = f;
cb->__x = x;
__do_cleanup_push(cb, f, x); __do_cleanup_push(cb, f, x);
} }
......
...@@ -46,8 +46,6 @@ void pthread_exit(void *result) ...@@ -46,8 +46,6 @@ void pthread_exit(void *result)
void __do_cleanup_push(struct __ptcb *cb, void (*f)(void *), void *x) void __do_cleanup_push(struct __ptcb *cb, void (*f)(void *), void *x)
{ {
struct pthread *self = pthread_self(); struct pthread *self = pthread_self();
cb->__f = f;
cb->__x = x;
cb->__next = self->cancelbuf; cb->__next = self->cancelbuf;
self->cancelbuf = cb; self->cancelbuf = cb;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册