33#include "pycore_pystate.h" // _PyThreadState_GET()
44#include "pycore_parser.h" // _PYPEGEN_NSTATISTICS
55#include "pycore_pyerrors.h" // PyExc_IncompleteInputError
6- #include "pycore_runtime.h" // _PyRuntime
6+ #include "pycore_runtime.h" // _PyRuntime
77#include "pycore_unicodeobject.h" // _PyUnicode_InternImmortal
8- #include "pycore_pyatomic_ft_wrappers.h"
98#include <errcode.h>
109
1110#include "lexer/lexer.h"
@@ -303,11 +302,11 @@ _PyPegen_fill_token(Parser *p)
303302void
304303_PyPegen_clear_memo_statistics (void )
305304{
306- FT_MUTEX_LOCK (& _PyRuntime .parser .mutex );
305+ PyMutex_Lock (& _PyRuntime .parser .mutex );
307306 for (int i = 0 ; i < NSTATISTICS ; i ++ ) {
308307 memo_statistics [i ] = 0 ;
309308 }
310- FT_MUTEX_UNLOCK (& _PyRuntime .parser .mutex );
309+ PyMutex_Unlock (& _PyRuntime .parser .mutex );
311310}
312311
313312PyObject *
@@ -318,22 +317,22 @@ _PyPegen_get_memo_statistics(void)
318317 return NULL ;
319318 }
320319
321- FT_MUTEX_LOCK (& _PyRuntime .parser .mutex );
320+ PyMutex_Lock (& _PyRuntime .parser .mutex );
322321 for (int i = 0 ; i < NSTATISTICS ; i ++ ) {
323322 PyObject * value = PyLong_FromLong (memo_statistics [i ]);
324323 if (value == NULL ) {
325- FT_MUTEX_UNLOCK (& _PyRuntime .parser .mutex );
324+ PyMutex_Unlock (& _PyRuntime .parser .mutex );
326325 Py_DECREF (ret );
327326 return NULL ;
328327 }
329328 // PyList_SetItem borrows a reference to value.
330329 if (PyList_SetItem (ret , i , value ) < 0 ) {
331- FT_MUTEX_UNLOCK (& _PyRuntime .parser .mutex );
330+ PyMutex_Unlock (& _PyRuntime .parser .mutex );
332331 Py_DECREF (ret );
333332 return NULL ;
334333 }
335334 }
336- FT_MUTEX_UNLOCK (& _PyRuntime .parser .mutex );
335+ PyMutex_Unlock (& _PyRuntime .parser .mutex );
337336 return ret ;
338337}
339338#endif
@@ -359,9 +358,9 @@ _PyPegen_is_memoized(Parser *p, int type, void *pres)
359358 if (count <= 0 ) {
360359 count = 1 ;
361360 }
362- FT_MUTEX_LOCK (& _PyRuntime .parser .mutex );
361+ PyMutex_Lock (& _PyRuntime .parser .mutex );
363362 memo_statistics [type ] += count ;
364- FT_MUTEX_UNLOCK (& _PyRuntime .parser .mutex );
363+ PyMutex_Unlock (& _PyRuntime .parser .mutex );
365364 }
366365#endif
367366 p -> mark = m -> mark ;
0 commit comments