mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Common/Crypto: #ifdef out unnecessary locking code for OpenSSL 1.1+ (PR #25110)
This commit is contained in:
committed by
GitHub
parent
690a095b94
commit
7ea33120a0
@@ -17,6 +17,8 @@
|
||||
|
||||
#include <OpenSSLCrypto.h>
|
||||
#include <openssl/crypto.h>
|
||||
|
||||
#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER < 0x1010000fL
|
||||
#include <vector>
|
||||
#include <thread>
|
||||
#include <mutex>
|
||||
@@ -62,3 +64,4 @@ void OpenSSLCrypto::threadsCleanup()
|
||||
}
|
||||
cryptoLocks.resize(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#define OPENSSL_CRYPTO_H
|
||||
|
||||
#include "Define.h"
|
||||
#include <openssl/opensslv.h>
|
||||
|
||||
/**
|
||||
* A group of functions which setup openssl crypto module to work properly in multithreaded enviroment
|
||||
@@ -26,10 +27,17 @@
|
||||
*/
|
||||
namespace OpenSSLCrypto
|
||||
{
|
||||
|
||||
#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER < 0x1010000fL
|
||||
/// Needs to be called before threads using openssl are spawned
|
||||
TC_COMMON_API void threadsSetup();
|
||||
/// Needs to be called after threads using openssl are despawned
|
||||
TC_COMMON_API void threadsCleanup();
|
||||
#else
|
||||
void threadsSetup() { };
|
||||
void threadsCleanup() { };
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user