diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2011-01-15 13:11:48 +0000 |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-01-15 13:11:48 +0000 |
commit | 7c442f71fbcd34c2502680f25075031066df40a5 (patch) | |
tree | 4f6a9821276543fa8ce5238f77059847a08c1e50 /Doc/c-api/init.rst | |
parent | 43a550e1683c3901f7c355e0fc7b93c39ab9ab45 (diff) | |
download | cpython-7c442f71fbcd34c2502680f25075031066df40a5.tar.gz |
Issue #10913: Deprecate misleading functions PyEval_AcquireLock() and
PyEval_ReleaseLock(). The thread-state aware APIs should be used instead.
Diffstat (limited to 'Doc/c-api/init.rst')
-rw-r--r-- | Doc/c-api/init.rst | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Doc/c-api/init.rst b/Doc/c-api/init.rst index f920909e64..fd1f7d0a7c 100644 --- a/Doc/c-api/init.rst +++ b/Doc/c-api/init.rst @@ -759,6 +759,10 @@ been created. *tstate*, which should not be *NULL*. The lock must have been created earlier. If this thread already has the lock, deadlock ensues. + :c:func:`PyEval_RestoreThread` is a higher-level function which is always + available (even when thread support isn't enabled or when threads have + not been initialized). + .. c:function:: void PyEval_ReleaseThread(PyThreadState *tstate) @@ -768,17 +772,31 @@ been created. that it represents the current thread state --- if it isn't, a fatal error is reported. + :c:func:`PyEval_SaveThread` is a higher-level function which is always + available (even when thread support isn't enabled or when threads have + not been initialized). + .. c:function:: void PyEval_AcquireLock() Acquire the global interpreter lock. The lock must have been created earlier. If this thread already has the lock, a deadlock ensues. + .. deprecated:: 3.2 + This function does not change the current thread state. Please use + :c:func:`PyEval_RestoreThread` or :c:func:`PyEval_AcquireThread` + instead. + .. c:function:: void PyEval_ReleaseLock() Release the global interpreter lock. The lock must have been created earlier. + .. deprecated:: 3.2 + This function does not change the current thread state. Please use + :c:func:`PyEval_SaveThread` or :c:func:`PyEval_ReleaseThread` + instead. + Sub-interpreter support ======================= |