thread_none.c
Go to the documentation of this file.
1 /* Copyright (c) 2015, Google Inc.
2  *
3  * Permission to use, copy, modify, and/or distribute this software for any
4  * purpose with or without fee is hereby granted, provided that the above
5  * copyright notice and this permission notice appear in all copies.
6  *
7  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
10  * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
12  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
13  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
14 
15 #include "internal.h"
16 
17 #if !defined(OPENSSL_THREADS)
18 
20 
22 
24 
26 
28 
30 
32 
34 
36 
38 
39 void CRYPTO_once(CRYPTO_once_t *once, void (*init)(void)) {
40  if (*once) {
41  return;
42  }
43  *once = 1;
44  init();
45 }
46 
48 
50  return g_thread_locals[index];
51 }
52 
54  thread_local_destructor_t destructor) {
56  return 1;
57 }
58 
59 #endif // !OPENSSL_THREADS
CRYPTO_MUTEX_unlock_write
void CRYPTO_MUTEX_unlock_write(CRYPTO_MUTEX *lock)
Definition: thread_none.c:27
init
const char * init
Definition: upb/upb/bindings/lua/main.c:49
CRYPTO_MUTEX_init
void CRYPTO_MUTEX_init(CRYPTO_MUTEX *lock)
Definition: thread_none.c:19
internal.h
CRYPTO_STATIC_MUTEX_lock_write
void CRYPTO_STATIC_MUTEX_lock_write(struct CRYPTO_STATIC_MUTEX *lock)
Definition: thread_none.c:33
CRYPTO_MUTEX_unlock_read
void CRYPTO_MUTEX_unlock_read(CRYPTO_MUTEX *lock)
Definition: thread_none.c:25
CRYPTO_STATIC_MUTEX
Definition: third_party/boringssl-with-bazel/src/crypto/internal.h:533
CRYPTO_MUTEX_lock_write
void CRYPTO_MUTEX_lock_write(CRYPTO_MUTEX *lock)
Definition: thread_none.c:23
CRYPTO_set_thread_local
int CRYPTO_set_thread_local(thread_local_data_t index, void *value, thread_local_destructor_t destructor)
Definition: thread_none.c:53
CRYPTO_MUTEX_lock_read
void CRYPTO_MUTEX_lock_read(CRYPTO_MUTEX *lock)
Definition: thread_none.c:21
CRYPTO_get_thread_local
void * CRYPTO_get_thread_local(thread_local_data_t index)
Definition: thread_none.c:49
CRYPTO_STATIC_MUTEX_unlock_read
void CRYPTO_STATIC_MUTEX_unlock_read(struct CRYPTO_STATIC_MUTEX *lock)
Definition: thread_none.c:35
g_thread_locals
static void * g_thread_locals[NUM_OPENSSL_THREAD_LOCALS]
Definition: thread_none.c:47
CRYPTO_STATIC_MUTEX_unlock_write
void CRYPTO_STATIC_MUTEX_unlock_write(struct CRYPTO_STATIC_MUTEX *lock)
Definition: thread_none.c:37
value
const char * value
Definition: hpack_parser_table.cc:165
CRYPTO_STATIC_MUTEX_lock_read
void CRYPTO_STATIC_MUTEX_lock_read(struct CRYPTO_STATIC_MUTEX *lock)
Definition: thread_none.c:31
CRYPTO_once
void CRYPTO_once(CRYPTO_once_t *once, void(*init)(void))
Definition: thread_none.c:39
once
absl::once_flag once
Definition: bm_opencensus_plugin.cc:38
thread_local_data_t
thread_local_data_t
Definition: third_party/boringssl-with-bazel/src/crypto/internal.h:635
index
int index
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/protobuf.h:1184
thread_local_destructor_t
void(* thread_local_destructor_t)(void *)
Definition: third_party/boringssl-with-bazel/src/crypto/internal.h:645
CRYPTO_once_t
uint32_t CRYPTO_once_t
Definition: third_party/boringssl-with-bazel/src/crypto/internal.h:470
CRYPTO_MUTEX_cleanup
void CRYPTO_MUTEX_cleanup(CRYPTO_MUTEX *lock)
Definition: thread_none.c:29
crypto_mutex_st
Definition: thread.h:70
NUM_OPENSSL_THREAD_LOCALS
@ NUM_OPENSSL_THREAD_LOCALS
Definition: third_party/boringssl-with-bazel/src/crypto/internal.h:640


grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:01:37