- enum SSLLockType { LOCK_MUTEX, LOCK_SPINLOCK, LOCK_SHAREDMUTEX, LOCK_NONE };
-
- /**
- * Set preferences for how to treat locks in OpenSSL. This must be
- * called before the instantiation of any SSLContext objects, otherwise
- * the defaults will be used.
- *
- * OpenSSL has a lock for each module rather than for each object or
- * data that needs locking. Some locks protect only refcounts, and
- * might be better as spinlocks rather than mutexes. Other locks
- * may be totally unnecessary if the objects being protected are not
- * shared between threads in the application.
- *
- * By default, all locks are initialized as mutexes. OpenSSL's lock usage
- * may change from version to version and you should know what you are doing
- * before disabling any locks entirely.
- *
- * Example: if you don't share SSL sessions between threads in your
- * application, you may be able to do this
- *
- * setSSLLockTypes({{CRYPTO_LOCK_SSL_SESSION, SSLContext::LOCK_NONE}})
- */
- static void setSSLLockTypes(std::map<int, SSLLockType> lockTypes);
-
- /**
- * Set the lock types and initialize OpenSSL in an atomic fashion. This
- * aborts if the library has already been initialized.
- */
- static void setSSLLockTypesAndInitOpenSSL(
- std::map<int, SSLLockType> lockTypes);
-
- /**
- * Determine if the SSL lock with the specified id (i.e.
- * CRYPTO_LOCK_SSL_SESSION) is disabled. This should be called after
- * initializeOpenSSL. This will only check if the specified lock has been
- * explicitly set to LOCK_NONE.
- *
- * This is not safe to call while setSSLLockTypes is being called.
- */
- static bool isSSLLockDisabled(int lockId);
-