Skip to content

Commit 5d8c093

Browse files
committed
add common object head for hashlib/hmac objects
1 parent aee45fd commit 5d8c093

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

Modules/hashlib.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@
4949
*/
5050

5151
#include "pythread.h"
52+
53+
#define HASHLIB_OBJECT_HEAD \
54+
PyObject_HEAD \
55+
/* prevent undefined behavior via multiple
56+
* threads entering the C API */ \
57+
bool use_mutex; \
58+
PyMutex mutex;
59+
5260
#define ENTER_HASHLIB(obj) \
5361
if ((obj)->use_mutex) { \
5462
PyMutex_Lock(&(obj)->mutex); \

0 commit comments

Comments
 (0)