summaryrefslogtreecommitdiffstats
path: root/Modules/hashlib.h
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/hashlib.h')
-rw-r--r--Modules/hashlib.h29
1 files changed, 12 insertions, 17 deletions
diff --git a/Modules/hashlib.h b/Modules/hashlib.h
index 530b6b1..978593e 100644
--- a/Modules/hashlib.h
+++ b/Modules/hashlib.h
@@ -39,24 +39,19 @@
* an operation.
*/
-#ifdef WITH_THREAD
#include "pythread.h"
- #define ENTER_HASHLIB(obj) \
- if ((obj)->lock) { \
- if (!PyThread_acquire_lock((obj)->lock, 0)) { \
- Py_BEGIN_ALLOW_THREADS \
- PyThread_acquire_lock((obj)->lock, 1); \
- Py_END_ALLOW_THREADS \
- } \
- }
- #define LEAVE_HASHLIB(obj) \
- if ((obj)->lock) { \
- PyThread_release_lock((obj)->lock); \
- }
-#else
- #define ENTER_HASHLIB(obj)
- #define LEAVE_HASHLIB(obj)
-#endif
+#define ENTER_HASHLIB(obj) \
+ if ((obj)->lock) { \
+ if (!PyThread_acquire_lock((obj)->lock, 0)) { \
+ Py_BEGIN_ALLOW_THREADS \
+ PyThread_acquire_lock((obj)->lock, 1); \
+ Py_END_ALLOW_THREADS \
+ } \
+ }
+#define LEAVE_HASHLIB(obj) \
+ if ((obj)->lock) { \
+ PyThread_release_lock((obj)->lock); \
+ }
/* TODO(gps): We should probably make this a module or EVPobject attribute
* to allow the user to optimize based on the platform they're using. */