summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2024-05-09 23:06:35 (GMT)
committerGitHub <noreply@github.com>2024-05-09 23:06:35 (GMT)
commitb62cb5234be2f43833e52063bf32bff5b2cffc98 (patch)
treea66ad745575f502845eb2075d90ef4124cd0d555 /Include
parent00ec116883f71d51b4f27fe7f6ea98cf1f176e6e (diff)
downloadcpython-b62cb5234be2f43833e52063bf32bff5b2cffc98.zip
cpython-b62cb5234be2f43833e52063bf32bff5b2cffc98.tar.gz
cpython-b62cb5234be2f43833e52063bf32bff5b2cffc98.tar.bz2
[3.13] Revert "gh-115432: Add critical section variant that handles a NULL object (GH-115433)" (GH-118861) (#118872)
This reverts commit ad4f909e0e7890e027c4ae7fea74586667242ad3. The API ended up not being used. (cherry picked from commit 46c808172fd3148e3397234b23674bf70734fb55) Co-authored-by: Sam Gross <colesbury@gmail.com>
Diffstat (limited to 'Include')
-rw-r--r--Include/internal/pycore_critical_section.h29
1 files changed, 0 insertions, 29 deletions
diff --git a/Include/internal/pycore_critical_section.h b/Include/internal/pycore_critical_section.h
index 23b85c2..573d09a 100644
--- a/Include/internal/pycore_critical_section.h
+++ b/Include/internal/pycore_critical_section.h
@@ -99,15 +99,6 @@ extern "C" {
_PyCriticalSection_End(&_cs); \
}
-# define Py_XBEGIN_CRITICAL_SECTION(op) \
- { \
- _PyCriticalSection _cs_opt = {0}; \
- _PyCriticalSection_XBegin(&_cs_opt, _PyObject_CAST(op))
-
-# define Py_XEND_CRITICAL_SECTION() \
- _PyCriticalSection_XEnd(&_cs_opt); \
- }
-
# define Py_BEGIN_CRITICAL_SECTION2(a, b) \
{ \
_PyCriticalSection2 _cs2; \
@@ -144,8 +135,6 @@ extern "C" {
# define Py_BEGIN_CRITICAL_SECTION_MUT(mut)
# define Py_BEGIN_CRITICAL_SECTION(op)
# define Py_END_CRITICAL_SECTION()
-# define Py_XBEGIN_CRITICAL_SECTION(op)
-# define Py_XEND_CRITICAL_SECTION()
# define Py_BEGIN_CRITICAL_SECTION2(a, b)
# define Py_END_CRITICAL_SECTION2()
# define _Py_CRITICAL_SECTION_ASSERT_MUTEX_LOCKED(mutex)
@@ -202,16 +191,6 @@ _PyCriticalSection_Begin(_PyCriticalSection *c, PyMutex *m)
}
}
-static inline void
-_PyCriticalSection_XBegin(_PyCriticalSection *c, PyObject *op)
-{
-#ifdef Py_GIL_DISABLED
- if (op != NULL) {
- _PyCriticalSection_Begin(c, &_PyObject_CAST(op)->ob_mutex);
- }
-#endif
-}
-
// Removes the top-most critical section from the thread's stack of critical
// sections. If the new top-most critical section is inactive, then it is
// resumed.
@@ -235,14 +214,6 @@ _PyCriticalSection_End(_PyCriticalSection *c)
}
static inline void
-_PyCriticalSection_XEnd(_PyCriticalSection *c)
-{
- if (c->mutex) {
- _PyCriticalSection_End(c);
- }
-}
-
-static inline void
_PyCriticalSection2_Begin(_PyCriticalSection2 *c, PyMutex *m1, PyMutex *m2)
{
if (m1 == m2) {