mirror of
https://github.com/python/cpython.git
synced 2024-11-27 23:47:29 +01:00
31c90d5838
Critical sections are helpers to replace the global interpreter lock with finer grained locking. They provide similar guarantees to the GIL and avoid the deadlock risk that plain locking involves. Critical sections are implicitly ended whenever the GIL would be released. They are resumed when the GIL would be acquired. Nested critical sections behave as if the sections were interleaved.
19 lines
471 B
C
19 lines
471 B
C
#ifndef Py_TESTINTERNALCAPI_PARTS_H
|
|
#define Py_TESTINTERNALCAPI_PARTS_H
|
|
|
|
// Always enable assertions
|
|
#undef NDEBUG
|
|
|
|
#ifndef Py_BUILD_CORE_BUILTIN
|
|
# define Py_BUILD_CORE_MODULE 1
|
|
#endif
|
|
|
|
#include "Python.h"
|
|
|
|
int _PyTestInternalCapi_Init_Lock(PyObject *module);
|
|
int _PyTestInternalCapi_Init_PyTime(PyObject *module);
|
|
int _PyTestInternalCapi_Init_Set(PyObject *module);
|
|
int _PyTestInternalCapi_Init_CriticalSection(PyObject *module);
|
|
|
|
#endif // Py_TESTINTERNALCAPI_PARTS_H
|