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
1cfe009b
Kaydet (Commit)
1cfe009b
authored
Ock 20, 2014
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
put notes in a ..note section
üst
f6ffb4b2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
ctypes.rst
Doc/library/ctypes.rst
+12
-12
No files found.
Doc/library/ctypes.rst
Dosyayı görüntüle @
1cfe009b
...
...
@@ -1022,18 +1022,18 @@ As we can easily check, our array is sorted now::
1 5 7 33 99
>>>
**Important notes for callback functions:**
Make sure you keep references to :func:`CFUNCTYPE` objects as long as they are
used from C code. :mod:`ctypes` doesn't, and if you don't, they may be garbag
e
collected, crashing your program when a callback is made.
Also, note that if the callback function is called in a thread created outside
of Python's control (e.g. by the foreign code that calls the callback), ctypes
creates a new dummy Python thread on every invocation. This behavior is correct
for most purposes, but it means that values stored with `threading.local` will
*not* survive across different callbacks, even when those calls are made from
the same C thread.
.. note::
Make sure you keep references to :func:`CFUNCTYPE` objects as long as they
are used from C code. :mod:`ctypes` doesn't, and if you don't, they may b
e
garbage
collected, crashing your program when a callback is made.
Also, note that if the callback function is called in a thread created
outside of Python's control (e.g. by the foreign code that calls the
callback), ctypes creates a new dummy Python thread on every invocation. This
behavior is correct for most purposes, but it means that values stored with
`threading.local` will *not* survive across different callbacks, even when
those calls are made from
the same C thread.
.. _ctypes-accessing-values-exported-from-dlls:
...
...
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