/src/openssl36/crypto/initthread.c
Line | Count | Source |
1 | | /* |
2 | | * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved. |
3 | | * |
4 | | * Licensed under the Apache License 2.0 (the "License"). You may not use |
5 | | * this file except in compliance with the License. You can obtain a copy |
6 | | * in the file LICENSE in the source distribution or at |
7 | | * https://www.openssl.org/source/license.html |
8 | | */ |
9 | | |
10 | | #include <openssl/crypto.h> |
11 | | #include <openssl/core_dispatch.h> |
12 | | #include "crypto/cryptlib.h" |
13 | | #include "prov/providercommon.h" |
14 | | #include "internal/thread_once.h" |
15 | | #include "internal/threads_common.h" |
16 | | #include "crypto/context.h" |
17 | | |
18 | | #ifdef FIPS_MODULE |
19 | | #include "prov/provider_ctx.h" |
20 | | |
21 | | /* |
22 | | * Thread aware code may want to be told about thread stop events. We register |
23 | | * to hear about those thread stop events when we see a new thread has started. |
24 | | * We call the ossl_init_thread_start function to do that. In the FIPS provider |
25 | | * we have our own copy of ossl_init_thread_start, which cascades notifications |
26 | | * about threads stopping from libcrypto to all the code in the FIPS provider |
27 | | * that needs to know about it. |
28 | | * |
29 | | * The FIPS provider tells libcrypto about which threads it is interested in |
30 | | * by calling "c_thread_start" which is a function pointer created during |
31 | | * provider initialisation (i.e. OSSL_provider_init). |
32 | | */ |
33 | | extern OSSL_FUNC_core_thread_start_fn *c_thread_start; |
34 | | #endif |
35 | | |
36 | | typedef struct thread_event_handler_st THREAD_EVENT_HANDLER; |
37 | | struct thread_event_handler_st { |
38 | | #ifndef FIPS_MODULE |
39 | | const void *index; |
40 | | #endif |
41 | | void *arg; |
42 | | OSSL_thread_stop_handler_fn handfn; |
43 | | THREAD_EVENT_HANDLER *next; |
44 | | }; |
45 | | |
46 | | #ifndef FIPS_MODULE |
47 | | DEFINE_SPECIAL_STACK_OF(THREAD_EVENT_HANDLER_PTR, THREAD_EVENT_HANDLER *) |
48 | | |
49 | | typedef struct global_tevent_register_st GLOBAL_TEVENT_REGISTER; |
50 | | struct global_tevent_register_st { |
51 | | STACK_OF(THREAD_EVENT_HANDLER_PTR) *skhands; |
52 | | CRYPTO_RWLOCK *lock; |
53 | | }; |
54 | | |
55 | | static GLOBAL_TEVENT_REGISTER *glob_tevent_reg = NULL; |
56 | | |
57 | | static CRYPTO_ONCE tevent_register_runonce = CRYPTO_ONCE_STATIC_INIT; |
58 | | |
59 | | DEFINE_RUN_ONCE_STATIC(create_global_tevent_register) |
60 | 275 | { |
61 | 275 | glob_tevent_reg = OPENSSL_zalloc(sizeof(*glob_tevent_reg)); |
62 | 275 | if (glob_tevent_reg == NULL) |
63 | 0 | return 0; |
64 | | |
65 | 275 | glob_tevent_reg->skhands = sk_THREAD_EVENT_HANDLER_PTR_new_null(); |
66 | 275 | glob_tevent_reg->lock = CRYPTO_THREAD_lock_new(); |
67 | 275 | if (glob_tevent_reg->skhands == NULL || glob_tevent_reg->lock == NULL) { |
68 | 0 | sk_THREAD_EVENT_HANDLER_PTR_free(glob_tevent_reg->skhands); |
69 | 0 | CRYPTO_THREAD_lock_free(glob_tevent_reg->lock); |
70 | 0 | OPENSSL_free(glob_tevent_reg); |
71 | 0 | glob_tevent_reg = NULL; |
72 | 0 | return 0; |
73 | 0 | } |
74 | | |
75 | 275 | return 1; |
76 | 275 | } |
77 | | |
78 | | static GLOBAL_TEVENT_REGISTER *get_global_tevent_register(void) |
79 | 1.00k | { |
80 | 1.00k | if (!RUN_ONCE(&tevent_register_runonce, create_global_tevent_register)) |
81 | 0 | return NULL; |
82 | 1.00k | return glob_tevent_reg; |
83 | 1.00k | } |
84 | | #endif |
85 | | |
86 | | #ifndef FIPS_MODULE |
87 | | /* |
88 | | * Since per-thread-specific-data destructors are not universally |
89 | | * available, i.e. not on Windows, only below CRYPTO_THREAD_LOCAL key |
90 | | * is assumed to have destructor associated. And then an effort is made |
91 | | * to call this single destructor on non-pthread platform[s]. |
92 | | * |
93 | | * Initial value is "impossible". It is used as guard value to shortcut |
94 | | * destructor for threads terminating before libcrypto is initialized or |
95 | | * after it's de-initialized. Access to the key doesn't have to be |
96 | | * serialized for the said threads, because they didn't use libcrypto |
97 | | * and it doesn't matter if they pick "impossible" or dereference real |
98 | | * key value and pull NULL past initialization in the first thread that |
99 | | * intends to use libcrypto. |
100 | | */ |
101 | | static union { |
102 | | long sane; |
103 | | CRYPTO_THREAD_LOCAL value; |
104 | | } destructor_key = { -1 }; |
105 | | |
106 | | static int init_thread_push_handlers(THREAD_EVENT_HANDLER **hands); |
107 | | static void init_thread_remove_handlers(THREAD_EVENT_HANDLER **handsin); |
108 | | static void init_thread_destructor(void *hands); |
109 | | static int init_thread_deregister(void *arg, int all); |
110 | | #endif |
111 | | static void init_thread_stop(void *arg, THREAD_EVENT_HANDLER **hands); |
112 | | |
113 | | static THREAD_EVENT_HANDLER **get_thread_event_handler(OSSL_LIB_CTX *ctx) |
114 | 250 | { |
115 | | #ifdef FIPS_MODULE |
116 | | return CRYPTO_THREAD_get_local_ex(CRYPTO_THREAD_LOCAL_TEVENT_KEY, ctx); |
117 | | #else |
118 | 250 | if (destructor_key.sane != -1) |
119 | 250 | return CRYPTO_THREAD_get_local(&destructor_key.value); |
120 | 0 | return NULL; |
121 | 250 | #endif |
122 | 250 | } |
123 | | |
124 | | static int set_thread_event_handler(OSSL_LIB_CTX *ctx, THREAD_EVENT_HANDLER **hands) |
125 | 161 | { |
126 | | #ifdef FIPS_MODULE |
127 | | return CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_TEVENT_KEY, ctx, hands); |
128 | | #else |
129 | 161 | if (destructor_key.sane != -1) |
130 | 161 | return CRYPTO_THREAD_set_local(&destructor_key.value, hands); |
131 | 0 | return 0; |
132 | 161 | #endif |
133 | 161 | } |
134 | | |
135 | | static THREAD_EVENT_HANDLER ** |
136 | | manage_thread_local(OSSL_LIB_CTX *ctx, int alloc, int keep) |
137 | 250 | { |
138 | 250 | THREAD_EVENT_HANDLER **hands = get_thread_event_handler(ctx); |
139 | | |
140 | 250 | if (alloc) { |
141 | 144 | if (hands == NULL) { |
142 | | |
143 | 108 | if ((hands = OPENSSL_zalloc(sizeof(*hands))) == NULL) |
144 | 0 | return NULL; |
145 | | |
146 | 108 | if (!set_thread_event_handler(ctx, hands)) { |
147 | 0 | OPENSSL_free(hands); |
148 | 0 | return NULL; |
149 | 0 | } |
150 | 108 | #ifndef FIPS_MODULE |
151 | 108 | if (!init_thread_push_handlers(hands)) { |
152 | 0 | set_thread_event_handler(ctx, NULL); |
153 | 0 | OPENSSL_free(hands); |
154 | 0 | return NULL; |
155 | 0 | } |
156 | 108 | #endif |
157 | 108 | } |
158 | 144 | } else if (!keep) { |
159 | 53 | set_thread_event_handler(ctx, NULL); |
160 | 53 | } |
161 | | |
162 | 250 | return hands; |
163 | 250 | } |
164 | | |
165 | | static ossl_inline THREAD_EVENT_HANDLER **clear_thread_local(OSSL_LIB_CTX *ctx) |
166 | 53 | { |
167 | 53 | return manage_thread_local(ctx, 0, 0); |
168 | 53 | } |
169 | | |
170 | | static ossl_inline ossl_unused THREAD_EVENT_HANDLER **fetch_thread_local(OSSL_LIB_CTX *ctx) |
171 | 53 | { |
172 | 53 | return manage_thread_local(ctx, 0, 1); |
173 | 53 | } |
174 | | |
175 | | static ossl_inline THREAD_EVENT_HANDLER **alloc_thread_local(OSSL_LIB_CTX *ctx) |
176 | 144 | { |
177 | 144 | return manage_thread_local(ctx, 1, 0); |
178 | 144 | } |
179 | | |
180 | | #ifndef FIPS_MODULE |
181 | | /* |
182 | | * The thread event handler list is a thread specific linked list |
183 | | * of callback functions which are invoked in list order by the |
184 | | * current thread in case of certain events. (Currently, there is |
185 | | * only one type of event, the 'thread stop' event.) |
186 | | * |
187 | | * We also keep a global reference to that linked list, so that we |
188 | | * can deregister handlers if necessary before all the threads are |
189 | | * stopped. |
190 | | */ |
191 | | static int init_thread_push_handlers(THREAD_EVENT_HANDLER **hands) |
192 | 275 | { |
193 | 275 | int ret; |
194 | 275 | GLOBAL_TEVENT_REGISTER *gtr; |
195 | | |
196 | 275 | gtr = get_global_tevent_register(); |
197 | 275 | if (gtr == NULL) |
198 | 0 | return 0; |
199 | | |
200 | 275 | if (!CRYPTO_THREAD_write_lock(gtr->lock)) |
201 | 0 | return 0; |
202 | 275 | ret = (sk_THREAD_EVENT_HANDLER_PTR_push(gtr->skhands, hands) != 0); |
203 | 275 | CRYPTO_THREAD_unlock(gtr->lock); |
204 | | |
205 | 275 | return ret; |
206 | 275 | } |
207 | | |
208 | | static void init_thread_remove_handlers(THREAD_EVENT_HANDLER **handsin) |
209 | 220 | { |
210 | 220 | GLOBAL_TEVENT_REGISTER *gtr; |
211 | 220 | int i; |
212 | | |
213 | 220 | gtr = get_global_tevent_register(); |
214 | 220 | if (gtr == NULL) |
215 | 0 | return; |
216 | 220 | if (!CRYPTO_THREAD_write_lock(gtr->lock)) |
217 | 0 | return; |
218 | 220 | for (i = 0; i < sk_THREAD_EVENT_HANDLER_PTR_num(gtr->skhands); i++) { |
219 | 220 | THREAD_EVENT_HANDLER **hands |
220 | 220 | = sk_THREAD_EVENT_HANDLER_PTR_value(gtr->skhands, i); |
221 | | |
222 | 220 | if (hands == handsin) { |
223 | 220 | sk_THREAD_EVENT_HANDLER_PTR_delete(gtr->skhands, i); |
224 | 220 | CRYPTO_THREAD_unlock(gtr->lock); |
225 | 220 | return; |
226 | 220 | } |
227 | 220 | } |
228 | 0 | CRYPTO_THREAD_unlock(gtr->lock); |
229 | 0 | return; |
230 | 220 | } |
231 | | |
232 | | static void init_thread_destructor(void *hands) |
233 | 0 | { |
234 | 0 | init_thread_stop(NULL, (THREAD_EVENT_HANDLER **)hands); |
235 | 0 | init_thread_remove_handlers(hands); |
236 | 0 | OPENSSL_free(hands); |
237 | 0 | } |
238 | | |
239 | | static CRYPTO_ONCE ossl_init_thread_runonce = CRYPTO_ONCE_STATIC_INIT; |
240 | | /* MSVC linker can use other segment for uninitialized (zeroed) variables */ |
241 | | #if defined(OPENSSL_SYS_WINDOWS) |
242 | | static CRYPTO_THREAD_ID recursion_guard = (CRYPTO_THREAD_ID)-1; |
243 | | #elif defined(OPENSSL_SYS_TANDEM) && (defined(_PUT_MODEL_) || defined(_KLT_MODEL_)) |
244 | | static CRYPTO_THREAD_ID recursion_guard = { (void *)-1, (short)-1, (short)-1 }; |
245 | | #else |
246 | | static CRYPTO_THREAD_ID recursion_guard = (CRYPTO_THREAD_ID)0; |
247 | | #endif |
248 | | |
249 | | DEFINE_RUN_ONCE_STATIC(ossl_init_thread_once) |
250 | 196 | { |
251 | | /* CRYPTO_THREAD_init_local() can call ossl_init_threads() again */ |
252 | 196 | recursion_guard = CRYPTO_THREAD_get_current_id(); |
253 | 196 | if (!CRYPTO_THREAD_init_local(&destructor_key.value, |
254 | 196 | init_thread_destructor)) |
255 | 0 | return 0; |
256 | | |
257 | | #if defined(OPENSSL_SYS_TANDEM) |
258 | | memset(&recursion_guard, 0, sizeof(recursion_guard)); |
259 | | #else |
260 | 196 | recursion_guard = (CRYPTO_THREAD_ID)0; |
261 | 196 | #endif |
262 | 196 | return 1; |
263 | 196 | } |
264 | | |
265 | | int ossl_init_thread(void) |
266 | 1.74k | { |
267 | 1.74k | if (CRYPTO_THREAD_compare_id(recursion_guard, |
268 | 1.74k | CRYPTO_THREAD_get_current_id())) |
269 | 196 | return 1; |
270 | 1.54k | if (!RUN_ONCE(&ossl_init_thread_runonce, ossl_init_thread_once)) |
271 | 0 | return 0; |
272 | 1.54k | return 1; |
273 | 1.54k | } |
274 | | |
275 | | void ossl_cleanup_thread(void) |
276 | 220 | { |
277 | 220 | init_thread_deregister(NULL, 1); |
278 | 220 | CRYPTO_THREAD_cleanup_local(&destructor_key.value); |
279 | 220 | destructor_key.sane = -1; |
280 | 220 | } |
281 | | |
282 | | void OPENSSL_thread_stop_ex(OSSL_LIB_CTX *ctx) |
283 | 0 | { |
284 | 0 | ctx = ossl_lib_ctx_get_concrete(ctx); |
285 | | /* |
286 | | * It would be nice if we could figure out a way to do this on all threads |
287 | | * that have used the OSSL_LIB_CTX when the context is freed. This is |
288 | | * currently not possible due to the use of thread local variables. |
289 | | */ |
290 | 0 | ossl_ctx_thread_stop(ctx); |
291 | 0 | } |
292 | | |
293 | | void OPENSSL_thread_stop(void) |
294 | 220 | { |
295 | 220 | if (destructor_key.sane != -1) { |
296 | 220 | THREAD_EVENT_HANDLER **hands = clear_thread_local(NULL); |
297 | | |
298 | 220 | init_thread_stop(NULL, hands); |
299 | | |
300 | 220 | init_thread_remove_handlers(hands); |
301 | 220 | OPENSSL_free(hands); |
302 | | |
303 | 220 | CRYPTO_THREAD_clean_local(); |
304 | 220 | } |
305 | 220 | } |
306 | | |
307 | | void ossl_ctx_thread_stop(OSSL_LIB_CTX *ctx) |
308 | 220 | { |
309 | 220 | if (destructor_key.sane != -1) { |
310 | 220 | THREAD_EVENT_HANDLER **hands = fetch_thread_local(ctx); |
311 | | |
312 | 220 | init_thread_stop(ctx, hands); |
313 | 220 | } |
314 | 220 | } |
315 | | |
316 | | #else |
317 | | |
318 | | static void ossl_arg_thread_stop(void *arg); |
319 | | |
320 | | /* Register the current thread so that we are informed if it gets stopped */ |
321 | | int ossl_thread_register_fips(OSSL_LIB_CTX *libctx) |
322 | | { |
323 | | return c_thread_start(FIPS_get_core_handle(libctx), ossl_arg_thread_stop, |
324 | | libctx); |
325 | | } |
326 | | |
327 | | int ossl_thread_event_ctx_new(OSSL_LIB_CTX *libctx) |
328 | | { |
329 | | THREAD_EVENT_HANDLER **hands = NULL; |
330 | | |
331 | | hands = OPENSSL_zalloc(sizeof(*hands)); |
332 | | if (hands == NULL) |
333 | | goto err; |
334 | | |
335 | | if (!CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_TEVENT_KEY, libctx, hands)) |
336 | | goto err; |
337 | | |
338 | | /* |
339 | | * We should ideally call ossl_thread_register_fips() here. This function |
340 | | * is called during the startup of the FIPS provider and we need to ensure |
341 | | * that the main thread is registered to receive thread callbacks in order |
342 | | * to free |hands| that we allocated above. However we are too early in |
343 | | * the FIPS provider initialisation that FIPS_get_core_handle() doesn't work |
344 | | * yet. So we defer this to the main provider OSSL_provider_init_int() |
345 | | * function. |
346 | | */ |
347 | | |
348 | | return 1; |
349 | | err: |
350 | | OPENSSL_free(hands); |
351 | | return 0; |
352 | | } |
353 | | |
354 | | void ossl_thread_event_ctx_free(OSSL_LIB_CTX *ctx) |
355 | | { |
356 | | CRYPTO_THREAD_set_local_ex(CRYPTO_THREAD_LOCAL_TEVENT_KEY, ctx, NULL); |
357 | | } |
358 | | |
359 | | static void ossl_arg_thread_stop(void *arg) |
360 | | { |
361 | | ossl_ctx_thread_stop((OSSL_LIB_CTX *)arg); |
362 | | } |
363 | | |
364 | | void ossl_ctx_thread_stop(OSSL_LIB_CTX *ctx) |
365 | | { |
366 | | THREAD_EVENT_HANDLER **hands; |
367 | | |
368 | | hands = clear_thread_local(ctx); |
369 | | init_thread_stop(ctx, hands); |
370 | | OPENSSL_free(hands); |
371 | | } |
372 | | #endif /* FIPS_MODULE */ |
373 | | |
374 | | static void init_thread_stop(void *arg, THREAD_EVENT_HANDLER **hands) |
375 | 440 | { |
376 | 440 | THREAD_EVENT_HANDLER *curr, *prev = NULL, *tmp; |
377 | 440 | #ifndef FIPS_MODULE |
378 | 440 | GLOBAL_TEVENT_REGISTER *gtr; |
379 | 440 | #endif |
380 | | |
381 | | /* Can't do much about this */ |
382 | 440 | if (hands == NULL) |
383 | 220 | return; |
384 | | |
385 | 220 | #ifndef FIPS_MODULE |
386 | 220 | gtr = get_global_tevent_register(); |
387 | 220 | if (gtr == NULL) |
388 | 0 | return; |
389 | | |
390 | 220 | if (!CRYPTO_THREAD_write_lock(gtr->lock)) |
391 | 0 | return; |
392 | 220 | #endif |
393 | | |
394 | 220 | curr = *hands; |
395 | 504 | while (curr != NULL) { |
396 | 284 | if (arg != NULL && curr->arg != arg) { |
397 | 0 | prev = curr; |
398 | 0 | curr = curr->next; |
399 | 0 | continue; |
400 | 0 | } |
401 | 284 | curr->handfn(curr->arg); |
402 | 284 | if (prev == NULL) |
403 | 284 | *hands = curr->next; |
404 | 0 | else |
405 | 0 | prev->next = curr->next; |
406 | | |
407 | 284 | tmp = curr; |
408 | 284 | curr = curr->next; |
409 | | |
410 | 284 | OPENSSL_free(tmp); |
411 | 284 | } |
412 | 220 | #ifndef FIPS_MODULE |
413 | 220 | CRYPTO_THREAD_unlock(gtr->lock); |
414 | 220 | #endif |
415 | 220 | } |
416 | | |
417 | | int ossl_init_thread_start(const void *index, void *arg, |
418 | | OSSL_thread_stop_handler_fn handfn) |
419 | 358 | { |
420 | 358 | THREAD_EVENT_HANDLER **hands; |
421 | 358 | THREAD_EVENT_HANDLER *hand; |
422 | 358 | OSSL_LIB_CTX *ctx = NULL; |
423 | | #ifdef FIPS_MODULE |
424 | | /* |
425 | | * In FIPS mode the list of THREAD_EVENT_HANDLERs is unique per combination |
426 | | * of OSSL_LIB_CTX and thread. This is because in FIPS mode each |
427 | | * OSSL_LIB_CTX gets informed about thread stop events individually. |
428 | | */ |
429 | | |
430 | | ctx = arg; |
431 | | #endif |
432 | | |
433 | 358 | hands = alloc_thread_local(ctx); |
434 | | |
435 | 358 | if (hands == NULL) |
436 | 0 | return 0; |
437 | | |
438 | | #ifdef FIPS_MODULE |
439 | | if (*hands == NULL) { |
440 | | /* |
441 | | * We've not yet registered any handlers for this thread. We need to get |
442 | | * libcrypto to tell us about later thread stop events. c_thread_start |
443 | | * is a callback to libcrypto defined in fipsprov.c |
444 | | */ |
445 | | if (!ossl_thread_register_fips(ctx)) |
446 | | return 0; |
447 | | } |
448 | | #endif |
449 | | |
450 | 358 | hand = OPENSSL_malloc(sizeof(*hand)); |
451 | 358 | if (hand == NULL) |
452 | 0 | return 0; |
453 | | |
454 | 358 | hand->handfn = handfn; |
455 | 358 | hand->arg = arg; |
456 | 358 | #ifndef FIPS_MODULE |
457 | 358 | hand->index = index; |
458 | 358 | #endif |
459 | 358 | hand->next = *hands; |
460 | 358 | *hands = hand; |
461 | | |
462 | 358 | return 1; |
463 | 358 | } |
464 | | |
465 | | #ifndef FIPS_MODULE |
466 | | static int init_thread_deregister(void *index, int all) |
467 | 292 | { |
468 | 292 | GLOBAL_TEVENT_REGISTER *gtr; |
469 | 292 | int i; |
470 | | |
471 | 292 | gtr = get_global_tevent_register(); |
472 | 292 | if (gtr == NULL) |
473 | 0 | return 0; |
474 | 292 | if (!all) { |
475 | 72 | if (!CRYPTO_THREAD_write_lock(gtr->lock)) |
476 | 0 | return 0; |
477 | 220 | } else { |
478 | 220 | glob_tevent_reg = NULL; |
479 | 220 | } |
480 | 292 | for (i = 0; i < sk_THREAD_EVENT_HANDLER_PTR_num(gtr->skhands); i++) { |
481 | 0 | THREAD_EVENT_HANDLER **hands |
482 | 0 | = sk_THREAD_EVENT_HANDLER_PTR_value(gtr->skhands, i); |
483 | 0 | THREAD_EVENT_HANDLER *curr = NULL, *prev = NULL, *tmp; |
484 | |
|
485 | 0 | if (hands == NULL) { |
486 | 0 | if (!all) |
487 | 0 | CRYPTO_THREAD_unlock(gtr->lock); |
488 | 0 | return 0; |
489 | 0 | } |
490 | 0 | curr = *hands; |
491 | 0 | while (curr != NULL) { |
492 | 0 | if (all || curr->index == index) { |
493 | 0 | if (prev != NULL) |
494 | 0 | prev->next = curr->next; |
495 | 0 | else |
496 | 0 | *hands = curr->next; |
497 | 0 | tmp = curr; |
498 | 0 | curr = curr->next; |
499 | 0 | OPENSSL_free(tmp); |
500 | 0 | continue; |
501 | 0 | } |
502 | 0 | prev = curr; |
503 | 0 | curr = curr->next; |
504 | 0 | } |
505 | 0 | if (all) |
506 | 0 | OPENSSL_free(hands); |
507 | 0 | } |
508 | 292 | if (all) { |
509 | 220 | CRYPTO_THREAD_lock_free(gtr->lock); |
510 | 220 | sk_THREAD_EVENT_HANDLER_PTR_free(gtr->skhands); |
511 | 220 | OPENSSL_free(gtr); |
512 | 220 | } else { |
513 | 72 | CRYPTO_THREAD_unlock(gtr->lock); |
514 | 72 | } |
515 | 292 | return 1; |
516 | 292 | } |
517 | | |
518 | | int ossl_init_thread_deregister(void *index) |
519 | 72 | { |
520 | 72 | return init_thread_deregister(index, 0); |
521 | 72 | } |
522 | | #endif |