We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3d71665 commit 0cd9bacCopy full SHA for 0cd9bac
Include/internal/pycore_dict.h
@@ -209,8 +209,14 @@ static inline PyDictUnicodeEntry* DK_UNICODE_ENTRIES(PyDictKeysObject *dk) {
209
#define DICT_VERSION_INCREMENT (1 << DICT_MAX_WATCHERS)
210
#define DICT_VERSION_MASK (DICT_VERSION_INCREMENT - 1)
211
212
+#ifdef Py_GIL_DISABLED
213
+#define DICT_NEXT_VERSION(INTERP) \
214
+ (_Py_atomic_add_uint64(&(INTERP)->dict_state.global_version, DICT_VERSION_INCREMENT) + DICT_VERSION_INCREMENT)
215
+
216
+#else
217
#define DICT_NEXT_VERSION(INTERP) \
218
((INTERP)->dict_state.global_version += DICT_VERSION_INCREMENT)
219
+#endif
220
221
void
222
_PyDict_SendEvent(int watcher_bits,
0 commit comments