mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-21 20:55:11 +00:00
Use :ref:deadlock-reference-label
This commit is contained in:
parent
5d0e95ca28
commit
e5734d275f
@ -1,3 +1,5 @@
|
|||||||
|
.. _deadlock-reference-label:
|
||||||
|
|
||||||
# Double locking, deadlocking, GIL
|
# Double locking, deadlocking, GIL
|
||||||
|
|
||||||
[TOC]
|
[TOC]
|
||||||
|
@ -63,10 +63,8 @@ back into Python.
|
|||||||
|
|
||||||
When writing C++ code that is called from other C++ code, if that code accesses
|
When writing C++ code that is called from other C++ code, if that code accesses
|
||||||
Python state, it must explicitly acquire and release the GIL. A separate
|
Python state, it must explicitly acquire and release the GIL. A separate
|
||||||
document on deadlocks [#f8]_ elaborates on a particularly subtle interaction
|
document on :ref:`deadlock-reference-label` elaborates on a particularly subtle
|
||||||
with C++'s block-scope static variable initializer guard mutexes.
|
interaction with C++'s block-scope static variable initializer guard mutexes.
|
||||||
|
|
||||||
.. [#f8] deadlock.md
|
|
||||||
|
|
||||||
The classes :class:`gil_scoped_release` and :class:`gil_scoped_acquire` can be
|
The classes :class:`gil_scoped_release` and :class:`gil_scoped_acquire` can be
|
||||||
used to acquire and release the global interpreter lock in the body of a C++
|
used to acquire and release the global interpreter lock in the body of a C++
|
||||||
@ -147,7 +145,7 @@ following checklist.
|
|||||||
of exceptions.
|
of exceptions.
|
||||||
|
|
||||||
- C++ static block-scope variable initialization that calls back into Python can
|
- C++ static block-scope variable initialization that calls back into Python can
|
||||||
cause deadlocks; see [#f8]_ for a detailed discussion.
|
cause deadlocks; see :ref:`deadlock-reference-label` for a detailed discussion.
|
||||||
|
|
||||||
- You should try running your code in a debug build. That will enable additional assertions
|
- You should try running your code in a debug build. That will enable additional assertions
|
||||||
within pybind11 that will throw exceptions on certain GIL handling errors
|
within pybind11 that will throw exceptions on certain GIL handling errors
|
||||||
|
Loading…
Reference in New Issue
Block a user