Merge branch 'master' into flake8++
diff --git a/OpenSSL/_util.py b/OpenSSL/_util.py
index a4b29e3..074ef3d 100644
--- a/OpenSSL/_util.py
+++ b/OpenSSL/_util.py
@@ -5,6 +5,7 @@
 
 from cryptography.hazmat.bindings.openssl.binding import Binding
 binding = Binding()
+binding.init_static_locks()
 ffi = binding.ffi
 lib = binding.lib
 
diff --git a/OpenSSL/crypto.py b/OpenSSL/crypto.py
index 446f7f8..b255ed6 100644
--- a/OpenSSL/crypto.py
+++ b/OpenSSL/crypto.py
@@ -2808,35 +2808,6 @@
     return pkcs12
 
 
-def _initialize_openssl_threads(get_ident, Lock):
-    import _ssl
-    return
-
-    locks = list(Lock() for n in range(_lib.CRYPTO_num_locks()))
-
-    def locking_function(mode, index, filename, line):
-        if mode & _lib.CRYPTO_LOCK:
-            locks[index].acquire()
-        else:
-            locks[index].release()
-
-    _lib.CRYPTO_set_id_callback(
-        _ffi.callback("unsigned long (*)(void)", get_ident))
-
-    _lib.CRYPTO_set_locking_callback(
-        _ffi.callback(
-            "void (*)(int, int, const char*, int)", locking_function))
-
-
-try:
-    from thread import get_ident
-    from threading import Lock
-except ImportError:
-    pass
-else:
-    _initialize_openssl_threads(get_ident, Lock)
-    del get_ident, Lock
-
 # There are no direct unit tests for this initialization.  It is tested
 # indirectly since it is necessary for functions like dump_privatekey when
 # using encryption.