-struct cleanup_args {
- pthread_t caller;
- int ret;
-};
-
-static void clean_dirty_tsd_callback(void *p)
-{
- struct cleanup_args *args = p;
- pthread_t self = __pthread_self();
- pthread_key_t i;
- for (i=0; i<PTHREAD_KEYS_MAX; i++) {
- if (keys[i] == dirty && self->tsd[i])
- self->tsd[i] = 0;
- }
- /* Arbitrary choice to avoid data race. */
- if (args->caller == self) args->ret = 0;
-}
-
-static void dummy2(void (*f)(void *), void *p)
-{
-}
-
-weak_alias(dummy2, __pthread_key_delete_synccall);
-
-static int clean_dirty_tsd(void)
-{
- struct cleanup_args args = {
- .caller = __pthread_self(),
- .ret = EAGAIN
- };
- __pthread_key_delete_synccall(clean_dirty_tsd_callback, &args);
- return args.ret;
-}
+weak_alias(dummy_0, __tl_lock);
+weak_alias(dummy_0, __tl_unlock);