Skip to content

Commit 0e5f12e

Browse files
change wording
1 parent 70d1237 commit 0e5f12e

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

Doc/c-api/init.rst

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2310,22 +2310,9 @@ Critical sections avoid deadlocks by implicitly suspending active critical
23102310
sections, hence, they do not provide exclusive access such as provided by
23112311
traditional locks like :c:type:`PyMutex`. When a critical section is started,
23122312
the per-object lock for the object is acquired. If the code executed inside the
2313-
critical section suspends the critical section, the per-object lock is released,
2314-
so other threads can acquire the per-object lock for the same object.
2315-
2316-
The critical sections can be suspended in the following situations:
2317-
2318-
* Calling back into Python code, such as calling a Python function or method.
2319-
2320-
* Calling any C API function which internally uses critical sections
2321-
such as :c:func:`PyList_Append` and :c:func:`PyDict_SetItem`.
2322-
2323-
* Locking of :c:type:`PyMutex` by :c:func:`PyMutex_Lock`.
2324-
2325-
* Calling :c:func:`PyEval_SaveThread` to detach the current thread.
2326-
2327-
* Recursively entering the critical section for the same object.
2328-
2313+
critical section calls C-API functions then it can suspend the critical section thereby
2314+
releasing the per-object lock, so other threads can acquire the per-object lock
2315+
for the same object.
23292316
23302317
Variants that accept :c:type:`PyMutex` pointers rather than Python objects are also
23312318
available. Use these variants to start a critical section in a situation where

0 commit comments

Comments
 (0)