File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3131
3232#include <Python.h>
3333#include "pycore_object.h" // _PyObject_VisitType()
34+ #include "pycore_pyatomic_ft_wrappers.h" // FT_ATOMIC_LOAD_SSIZE_RELAXED() and FT_ATOMIC_STORE_SSIZE_RELAXED()
3435#include "pycore_pystate.h" // _PyThreadState_GET()
3536#include "pycore_tuple.h" // _PyTuple_FromPair
3637#include "pycore_typeobject.h"
@@ -5921,11 +5922,13 @@ static Py_hash_t
59215922dec_hash (PyObject * op )
59225923{
59235924 PyDecObject * self = _PyDecObject_CAST (op );
5924- if (self -> hash == -1 ) {
5925- self -> hash = _dec_hash (self );
5925+ Py_hash_t hash = FT_ATOMIC_LOAD_SSIZE_RELAXED (self -> hash );
5926+ if (hash == -1 ) {
5927+ hash = _dec_hash (self );
5928+ FT_ATOMIC_STORE_SSIZE_RELAXED (self -> hash , hash );
59265929 }
59275930
5928- return self -> hash ;
5931+ return hash ;
59295932}
59305933
59315934/*[clinic input]
You can’t perform that action at this time.
0 commit comments