Unverified Commit 344b4ead by Edward Thomson Committed by GitHub

Merge pull request #4427 from pks-t/pks/openssl-threadid

openssl: fix thread-safety on non-glibc POSIX systems
parents 494a2f23 2d2e70f8
......@@ -150,11 +150,20 @@ int git_openssl_stream_global_init(void)
return 0;
}
#if defined(GIT_THREADS)
static void threadid_cb(CRYPTO_THREADID *threadid)
{
CRYPTO_THREADID_set_numeric(threadid, git_thread_currentid());
}
#endif
int git_openssl_set_locking(void)
{
#if defined(GIT_THREADS) && OPENSSL_VERSION_NUMBER < 0x10100000L
int num_locks, i;
CRYPTO_THREADID_set_callback(threadid_cb);
num_locks = CRYPTO_num_locks();
openssl_locks = git__calloc(num_locks, sizeof(git_mutex));
GITERR_CHECK_ALLOC(openssl_locks);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment