File tree Expand file tree Collapse file tree 1 file changed +12
-17
lines changed Expand file tree Collapse file tree 1 file changed +12
-17
lines changed Original file line number Diff line number Diff line change 3939 * an operation.
4040 */
4141
42- #ifdef WITH_THREAD
4342#include "pythread.h"
44- #define ENTER_HASHLIB (obj ) \
45- if ((obj)->lock) { \
46- if (!PyThread_acquire_lock((obj)->lock, 0)) { \
47- Py_BEGIN_ALLOW_THREADS \
48- PyThread_acquire_lock((obj)->lock, 1); \
49- Py_END_ALLOW_THREADS \
50- } \
51- }
52- #define LEAVE_HASHLIB (obj ) \
53- if ((obj)->lock) { \
54- PyThread_release_lock((obj)->lock); \
55- }
56- #else
57- #define ENTER_HASHLIB (obj )
58- #define LEAVE_HASHLIB (obj )
59- #endif
43+ #define ENTER_HASHLIB (obj ) \
44+ if ((obj)->lock) { \
45+ if (!PyThread_acquire_lock((obj)->lock, 0)) { \
46+ Py_BEGIN_ALLOW_THREADS \
47+ PyThread_acquire_lock((obj)->lock, 1); \
48+ Py_END_ALLOW_THREADS \
49+ } \
50+ }
51+ #define LEAVE_HASHLIB (obj ) \
52+ if ((obj)->lock) { \
53+ PyThread_release_lock((obj)->lock); \
54+ }
6055
6156/* TODO(gps): We should probably make this a module or EVPobject attribute
6257 * to allow the user to optimize based on the platform they're using. */
You can’t perform that action at this time.
0 commit comments