Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
371d98ab
Kaydet (Commit)
371d98ab
authored
Tem 10, 2004
tarafından
Andrew M. Kuchling
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
[Bug #987835] Add documentation from PEP 311. (Untested TeX code.)
üst
3f419745
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
init.tex
Doc/api/init.tex
+36
-0
No files found.
Doc/api/init.tex
Dosyayı görüntüle @
371d98ab
...
...
@@ -699,6 +699,42 @@ interpreter lock has been created.
\versionadded
{
2.3
}
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyGILState
_
STATE
}{
PyGILState
_
Ensure
}{}
Ensure that the current thread is ready to call the Python
C API regardless of the current state of Python, or of its
thread lock. This may be called as many times as desired
by a thread as long as each call is matched with a call to
\cfunction
{
PyGILState
_
Release()
}
.
In general, other thread-related APIs may
be used between
\cfunction
{
PyGILState
_
Ensure()
}
and
\cfunction
{
PyGILState
_
Release()
}
calls as long as the
thread state is restored to its previous state before the Release().
For example, normal usage of the
\csimplemacro
{
Py
_
BEGIN
_
ALLOW
_
THREADS
}
and
\csimplemacro
{
Py
_
END
_
ALLOW
_
THREADS
}
macros is acceptable.
The return value is an opaque "handle" to the thread state when
\cfunction
{
PyGILState
_
Acquire()
}
was called, and must be passed to
\cfunction
{
PyGILState
_
Release()
}
to ensure Python is left in the same
state. Even though recursive calls are allowed, these handles
\emph
{
cannot
}
be shared - each unique call to
\cfunction
{
PyGILState
_
Ensure
}
must save the handle for its call to
\cfunction
{
PyGILState
_
Release
}
.
When the function returns, the current thread will hold the GIL.
Failure is a fatal error.
\versionadded
{
2.3
}
\end{cfuncdesc}
\begin{cfuncdesc}
{
void
}{
PyGILState
_
Release
}{
PyGILState
_
STATE
}
Release any resources previously acquired. After this call, Python's
state will be the same as it was prior to the corresponding
\cfunction
{
PyGILState
_
Ensure
}
call (but generally this state will be unknown to
the caller, hence the use of the GILState API.)
Every call to
\cfunction
{
PyGILState
_
Ensure()
}
must be matched by a call to
\cfunction
{
PyGILState
_
Release()
}
on the same thread.
\versionadded
{
2.3
}
\end{cfuncdesc}
\section
{
Profiling and Tracing
\label
{
profiling
}}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment