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 d9e4b00 commit 3ac82ecCopy full SHA for 3ac82ec
1 file changed
multidict/_multilib/state.h
@@ -130,10 +130,8 @@ get_mod_state_by_def(PyObject *self)
130
static inline uint64_t
131
NEXT_VERSION(mod_state *state)
132
{
133
- /* threads have the ability to screw with the global version,
134
- * using an atomic variable ensures the global version is
135
- * always accurate. */
136
- return atomic_fetch_add(&state->global_version, 1) + 1;
+ /* relaxed is fine here as we only care about the atomicity of the RMW itself */
+ return atomic_fetch_add_explicit(&state->global_version, 1, memory_order_relaxed) + 1
137
}
138
139
#ifdef __cplusplus
0 commit comments