#NEWLINE# def _initialize_openssl_threads( get_ident , Lock ) : #NEWLINE# #INDENT# import _ssl #NEWLINE# return #NEWLINE# locks = list ( ( Lock ( ) for n in range ( _lib . CRYPTO_num_locks ( ) ) ) ) #NEWLINE# def locking_function( mode , index , filename , line ) : #NEWLINE# #INDENT# if ( mode & _lib . CRYPTO_LOCK ) : #NEWLINE# #INDENT# locks [ index ] . acquire ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# locks [ index ] . release ( ) #NEWLINE# #UNINDENT# #UNINDENT# _lib . CRYPTO_set_id_callback ( _ffi . callback ( 'unsigned long (*)(void)' , get_ident ) ) #NEWLINE# _lib . CRYPTO_set_locking_callback ( _ffi . callback ( 'void (*)(int, int, const char*, int)' , get_ident ) )