File tree Expand file tree Collapse file tree 1 file changed +3
-16
lines changed
Expand file tree Collapse file tree 1 file changed +3
-16
lines changed Original file line number Diff line number Diff line change @@ -2310,22 +2310,9 @@ Critical sections avoid deadlocks by implicitly suspending active critical
23102310sections, hence, they do not provide exclusive access such as provided by
23112311traditional locks like :c:type:`PyMutex`. When a critical section is started,
23122312the 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
23302317Variants that accept :c:type:`PyMutex` pointers rather than Python objects are also
23312318available. Use these variants to start a critical section in a situation where
You can’t perform that action at this time.
0 commit comments