[Python-checkins] python/dist/src/Doc/api init.tex,1.20,1.21
tim_one at users.sourceforge.net
tim_one at users.sourceforge.net
Mon Oct 11 04:41:08 CEST 2004
Update of /cvsroot/python/python/dist/src/Doc/api
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23529/Doc/api
Modified Files:
init.tex
Log Message:
SF patch 1044089: New C API function PyEval_ThreadsInitialized(), by Nick
Coghlan, for determining whether PyEval_InitThreads() has been called.
Also purged the undocumented+unused _PyThread_Started int.
Index: init.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/api/init.tex,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- init.tex 19 Aug 2004 11:31:55 -0000 1.20
+++ init.tex 11 Oct 2004 02:40:35 -0000 1.21
@@ -24,7 +24,7 @@
\end{cfuncdesc}
\begin{cfuncdesc}{void}{Py_InitializeEx}{int initsigs}
- This function works like \cfunction{Py_Initialize} if
+ This function works like \cfunction{Py_Initialize()} if
\var{initsigs} is 1. If \var{initsigs} is 0, it skips
initialization registration of signal handlers, which
might be useful when Python is embedded. \versionadded{2.4}
@@ -517,14 +517,14 @@
This is a common situation (most Python programs do not use
threads), and the lock operations slow the interpreter down a bit.
Therefore, the lock is not created initially. This situation is
- equivalent to having acquired the lock: when there is only a single
+ equivalent to having acquired the lock: when there is only a single
thread, all object accesses are safe. Therefore, when this function
initializes the lock, it also acquires it. Before the Python
\module{thread}\refbimodindex{thread} module creates a new thread,
knowing that either it has the lock or the lock hasn't been created
yet, it calls \cfunction{PyEval_InitThreads()}. When this call
- returns, it is guaranteed that the lock has been created and that it
- has acquired it.
+ returns, it is guaranteed that the lock has been created and that the
+ calling thread has acquired it.
It is \strong{not} safe to call this function when it is unknown
which thread (if any) currently has the global interpreter lock.
@@ -533,6 +533,14 @@
compile time.
\end{cfuncdesc}
+\begin{cfuncdesc}{int}{PyEval_ThreadsInitialized}{}
+ Returns a non-zero value if \cfunction{PyEval_InitThreads()} has been
+ called. This function can be called without holding the lock, and
+ therefore can be used to avoid calls to the locking API when running
+ single-threaded. This function is not available when thread support
+ is disabled at compile time. \versionadded{2.4}
+\end{cfuncdesc}
+
\begin{cfuncdesc}{void}{PyEval_AcquireLock}{}
Acquire the global interpreter lock. The lock must have been
created earlier. If this thread already has the lock, a deadlock
More information about the Python-checkins
mailing list