static void once_init(void) { if ((unsigned long) acl_pthread_self() == acl_main_thread_self()) { acl_pthread_key_create(&once_key, dummy); atexit(main_free_tls); } else acl_pthread_key_create(&once_key, free_tls); }
static void slice_key_init(void) { unsigned long curr_tid = (unsigned long) acl_pthread_self(); unsigned long main_tid = (unsigned long) acl_main_thread_self(); if (curr_tid == main_tid) { acl_pthread_key_create(&__mem_slice_key, NULL); atexit(main_thread_slice_free); } else acl_pthread_key_create(&__mem_slice_key, (void (*)(void*)) mem_slice_free); }
static void cache_init(void) { acl_pthread_key_create(&cache_key, (void (*)(void*)) thread_cache_free); }
static void thread_init(void) { acl_assert(acl_pthread_key_create(&__fiber_key, thread_free) == 0); }
static void thread_buf_init(void) { acl_pthread_key_create(&__errbuf_key, thread_free_buf); }
static void thread_epoll_once(void) { acl_assert(acl_pthread_key_create(&epoll_key, thread_epoll_end) == 0); }
static void thread_once(void) { if (acl_pthread_key_create(&__thread_key, thread_free_dummy) != 0) abort(); }
static void thread_init_once() { acl_pthread_key_create(&stream_key, close_stream); }