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
187aa545
Kaydet (Commit)
187aa545
authored
Haz 05, 2012
tarafından
Kristján Valur Jónsson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Signal condition variables with the mutex held. Destroy condition variables
before their mutexes.
üst
902274e9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
10 deletions
+14
-10
ceval_gil.h
Python/ceval_gil.h
+5
-4
thread_pthread.h
Python/thread_pthread.h
+9
-6
No files found.
Python/ceval_gil.h
Dosyayı görüntüle @
187aa545
...
...
@@ -313,13 +313,14 @@ static void create_gil(void)
static
void
destroy_gil
(
void
)
{
MUTEX_FINI
(
gil_mutex
);
#ifdef FORCE_SWITCHING
MUTEX_FINI
(
switch_mutex
);
#endif
/* some pthread-like implementations tie the mutex to the cond
* and must have the cond destroyed first.
*/
COND_FINI
(
gil_cond
);
MUTEX_FINI
(
gil_mutex
);
#ifdef FORCE_SWITCHING
COND_FINI
(
switch_cond
);
MUTEX_FINI
(
switch_mutex
);
#endif
_Py_atomic_store_explicit
(
&
gil_locked
,
-
1
,
_Py_memory_order_release
);
_Py_ANNOTATE_RWLOCK_DESTROY
(
&
gil_locked
);
...
...
Python/thread_pthread.h
Dosyayı görüntüle @
187aa545
...
...
@@ -443,12 +443,15 @@ PyThread_free_lock(PyThread_type_lock lock)
dprintf
((
"PyThread_free_lock(%p) called
\n
"
,
lock
));
status
=
pthread_mutex_destroy
(
&
thelock
->
mut
);
CHECK_STATUS
(
"pthread_mutex_destroy"
);
/* some pthread-like implementations tie the mutex to the cond
* and must have the cond destroyed first.
*/
status
=
pthread_cond_destroy
(
&
thelock
->
lock_released
);
CHECK_STATUS
(
"pthread_cond_destroy"
);
status
=
pthread_mutex_destroy
(
&
thelock
->
mut
);
CHECK_STATUS
(
"pthread_mutex_destroy"
);
free
((
void
*
)
thelock
);
}
...
...
@@ -531,12 +534,12 @@ PyThread_release_lock(PyThread_type_lock lock)
thelock
->
locked
=
0
;
status
=
pthread_mutex_unlock
(
&
thelock
->
mut
);
CHECK_STATUS
(
"pthread_mutex_unlock[3]"
);
/* wake up someone (anyone, if any) waiting on the lock */
status
=
pthread_cond_signal
(
&
thelock
->
lock_released
);
CHECK_STATUS
(
"pthread_cond_signal"
);
status
=
pthread_mutex_unlock
(
&
thelock
->
mut
);
CHECK_STATUS
(
"pthread_mutex_unlock[3]"
);
}
#endif
/* USE_SEMAPHORES */
...
...
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