MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / initCryptoLocks

Function initCryptoLocks

src/tls.cpp:136–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134}
135
136static void initCryptoLocks(void) {
137 unsigned i, nlocks;
138 if (CRYPTO_get_locking_callback() != NULL) {
139 /* Someone already set the callback before us. Don't destroy it! */
140 return;
141 }
142 nlocks = CRYPTO_num_locks();
143 openssl_locks = (pthread_mutex_t*)zmalloc(sizeof(*openssl_locks) * nlocks);
144 for (i = 0; i < nlocks; i++) {
145 pthread_mutex_init(openssl_locks + i, NULL);
146 }
147 CRYPTO_set_locking_callback(sslLockingCallback);
148}
149#endif /* USE_CRYPTO_LOCKS */
150
151void tlsInit(void) {

Callers 1

tlsInitFunction · 0.85

Calls 1

zmallocFunction · 0.85

Tested by

no test coverage detected