MCPcopy Create free account
hub / github.com/3rdparty/libprocess / locking_function

Function locking_function

src/openssl.cpp:222–229  ·  view source on GitHub ↗

Callback needed to perform locking on shared data structures. From the OpenSSL documentation: OpenSSL uses a number of global data structures that will be implicitly shared whenever multiple threads use OpenSSL. Multi-threaded applications will crash at random if [the locking function] is not set.

Source from the content-addressed store, hash-verified

220// Multi-threaded applications will crash at random if [the locking
221// function] is not set.
222void locking_function(int mode, int n, const char* /*file*/, int /*line*/)
223{
224 if (mode & CRYPTO_LOCK) {
225 mutexes[n].lock();
226 } else {
227 mutexes[n].unlock();
228 }
229}
230
231
232// OpenSSL callback that returns the current thread ID, necessary for

Callers

nothing calls this directly

Calls 2

lockMethod · 0.80
unlockMethod · 0.80

Tested by

no test coverage detected