Lines Matching refs:wrapper
19 tsd_wrapper_t *wrapper = (tsd_wrapper_t *)TlsGetValue(tsd_tsd); in tsd_cleanup_wrapper() local
22 if (wrapper == NULL) { in tsd_cleanup_wrapper()
26 if (wrapper->initialized) { in tsd_cleanup_wrapper()
27 wrapper->initialized = false; in tsd_cleanup_wrapper()
28 tsd_cleanup(&wrapper->val); in tsd_cleanup_wrapper()
29 if (wrapper->initialized) { in tsd_cleanup_wrapper()
34 malloc_tsd_dalloc(wrapper); in tsd_cleanup_wrapper()
39 tsd_wrapper_set(tsd_wrapper_t *wrapper) { in tsd_wrapper_set() argument
40 if (!TlsSetValue(tsd_tsd, (void *)wrapper)) { in tsd_wrapper_set()
49 tsd_wrapper_t *wrapper = (tsd_wrapper_t *) TlsGetValue(tsd_tsd); in tsd_wrapper_get() local
52 if (init && unlikely(wrapper == NULL)) { in tsd_wrapper_get()
53 wrapper = (tsd_wrapper_t *) in tsd_wrapper_get()
55 if (wrapper == NULL) { in tsd_wrapper_get()
59 wrapper->initialized = false; in tsd_wrapper_get()
62 wrapper->val = tsd_initializer; in tsd_wrapper_get()
64 tsd_wrapper_set(wrapper); in tsd_wrapper_get()
66 return wrapper; in tsd_wrapper_get()
83 tsd_wrapper_t *wrapper; in tsd_boot1() local
84 wrapper = (tsd_wrapper_t *) in tsd_boot1()
86 if (wrapper == NULL) { in tsd_boot1()
92 wrapper->initialized = false; in tsd_boot1()
94 wrapper->val = initializer; in tsd_boot1()
95 tsd_wrapper_set(wrapper); in tsd_boot1()
119 tsd_wrapper_t *wrapper; in tsd_get() local
122 wrapper = tsd_wrapper_get(init); in tsd_get()
123 if (tsd_get_allocates() && !init && wrapper == NULL) { in tsd_get()
126 return &wrapper->val; in tsd_get()
131 tsd_wrapper_t *wrapper; in tsd_set() local
134 wrapper = tsd_wrapper_get(true); in tsd_set()
135 if (likely(&wrapper->val != val)) { in tsd_set()
136 wrapper->val = *(val); in tsd_set()
138 wrapper->initialized = true; in tsd_set()