Guard SSLContext lock checks with init mutex and add setSSLLockTypesAndInitOpenSSL
authorNeel Goyal <ngoyal@fb.com>
Tue, 25 Apr 2017 14:31:39 +0000 (07:31 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Tue, 25 Apr 2017 14:35:44 +0000 (07:35 -0700)
commit5699919fdcb518d9974a93c7f1791d3e8ac2a544
tree378bc2be85e7f0be0ff31218a143ad957e0e569d
parent2c3711992f55f2d0a9f0e37b89e1647d26aa5f6d
Guard SSLContext lock checks with init mutex and add setSSLLockTypesAndInitOpenSSL

Summary:
Improve concurrency guards for `setSSLLockTypes` and `isSSLLockDisabled` by using initMutex.  Also verify that openssl has been initialized w/ DCHECK in isSSLLockDisabled.

We also add a method to do the setting of locks and initialization in one shot.

Reviewed By: knekritz

Differential Revision: D4937242

fbshipit-source-id: 308f516c17485281604d4322954c09beb58688e2
folly/io/async/SSLContext.cpp
folly/io/async/SSLContext.h
folly/io/async/test/AsyncSSLSocketTest2.cpp