projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix broken sysconf when correct value is -1
[musl]
/
src
/
thread
/
cancellation.c
diff --git
a/src/thread/cancellation.c
b/src/thread/cancellation.c
index
b02cdfb
..
ab7eebc
100644
(file)
--- a/
src/thread/cancellation.c
+++ b/
src/thread/cancellation.c
@@
-1,23
+1,23
@@
#include "pthread_impl.h"
#include "pthread_impl.h"
-static void dummy(struct __ptcb *cb)
-{
-}
-weak_alias(dummy, __pthread_do_unwind);
-weak_alias(dummy, __pthread_do_register);
-weak_alias(dummy, __pthread_do_unregister);
+void __do_cleanup_push();
+void __do_cleanup_pop();
-void _
_pthread_unwind_next(struct __ptcb *cb
)
+void _
pthread_cleanup_push(struct __ptcb *cb, void (*f)(void *), void *x
)
{
{
- __pthread_do_unwind(cb);
+ cb->__f = f;
+ cb->__x = x;
+ __do_cleanup_push(cb, f, x);
}
}
-void _
_pthread_register_cancel(struct __ptcb *cb
)
+void _
pthread_cleanup_pop(struct __ptcb *cb, int run
)
{
{
- __pthread_do_register(cb);
+ __do_cleanup_pop(cb, run);
+ if (run) cb->__f(cb->__x);
}
}
-
void __pthread_unregister_cancel(struct __ptcb *cb
)
+
static void dummy(
)
{
{
- __pthread_do_unregister(cb);
}
}
+weak_alias(dummy, __do_cleanup_push);
+weak_alias(dummy, __do_cleanup_pop);