Skip to content

Commit e5eee4b

Browse files
pitroumcepl
authored andcommitted
bpo-31370: Remove support for threads-less builds (python#3385)
* Remove Setup.config * Always define WITH_THREAD for compatibility.
1 parent 7e161dc commit e5eee4b

File tree

1 file changed

+12
-17
lines changed

1 file changed

+12
-17
lines changed

Modules/hashlib.h

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -39,24 +39,19 @@
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. */

0 commit comments

Comments
 (0)