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
80aa565f
Kaydet (Commit)
80aa565f
authored
Tem 07, 2013
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #18203: Replace malloc() with PyMem_RawMalloc() to allocate thread locks
üst
b7f1f65f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
thread_nt.h
Python/thread_nt.h
+4
-4
thread_pthread.h
Python/thread_pthread.h
+6
-6
No files found.
Python/thread_nt.h
Dosyayı görüntüle @
80aa565f
...
...
@@ -34,7 +34,7 @@ typedef NRMUTEX *PNRMUTEX;
PNRMUTEX
AllocNonRecursiveMutex
()
{
PNRMUTEX
m
=
(
PNRMUTEX
)
m
alloc
(
sizeof
(
NRMUTEX
));
PNRMUTEX
m
=
(
PNRMUTEX
)
PyMem_RawM
alloc
(
sizeof
(
NRMUTEX
));
if
(
!
m
)
return
NULL
;
if
(
PyCOND_INIT
(
&
m
->
cv
))
...
...
@@ -46,7 +46,7 @@ AllocNonRecursiveMutex()
m
->
locked
=
0
;
return
m
;
fail:
f
ree
(
m
);
PyMem_RawF
ree
(
m
);
return
NULL
;
}
...
...
@@ -56,7 +56,7 @@ FreeNonRecursiveMutex(PNRMUTEX mutex)
if
(
mutex
)
{
PyCOND_FINI
(
&
mutex
->
cv
);
PyMUTEX_FINI
(
&
mutex
->
cs
);
f
ree
(
mutex
);
PyMem_RawF
ree
(
mutex
);
}
}
...
...
@@ -107,7 +107,7 @@ LeaveNonRecursiveMutex(PNRMUTEX mutex)
result
=
PyCOND_SIGNAL
(
&
mutex
->
cv
);
result
&=
PyMUTEX_UNLOCK
(
&
mutex
->
cs
);
return
result
;
}
}
#else
/* if ! _PY_USE_CV_LOCKS */
...
...
Python/thread_pthread.h
Dosyayı görüntüle @
80aa565f
...
...
@@ -282,14 +282,14 @@ PyThread_allocate_lock(void)
if
(
!
initialized
)
PyThread_init_thread
();
lock
=
(
sem_t
*
)
m
alloc
(
sizeof
(
sem_t
));
lock
=
(
sem_t
*
)
PyMem_RawM
alloc
(
sizeof
(
sem_t
));
if
(
lock
)
{
status
=
sem_init
(
lock
,
0
,
1
);
CHECK_STATUS
(
"sem_init"
);
if
(
error
)
{
f
ree
((
void
*
)
lock
);
PyMem_RawF
ree
((
void
*
)
lock
);
lock
=
NULL
;
}
}
...
...
@@ -313,7 +313,7 @@ PyThread_free_lock(PyThread_type_lock lock)
status
=
sem_destroy
(
thelock
);
CHECK_STATUS
(
"sem_destroy"
);
f
ree
((
void
*
)
thelock
);
PyMem_RawF
ree
((
void
*
)
thelock
);
}
/*
...
...
@@ -410,7 +410,7 @@ PyThread_allocate_lock(void)
if
(
!
initialized
)
PyThread_init_thread
();
lock
=
(
pthread_lock
*
)
m
alloc
(
sizeof
(
pthread_lock
));
lock
=
(
pthread_lock
*
)
PyMem_RawM
alloc
(
sizeof
(
pthread_lock
));
if
(
lock
)
{
memset
((
void
*
)
lock
,
'\0'
,
sizeof
(
pthread_lock
));
lock
->
locked
=
0
;
...
...
@@ -430,7 +430,7 @@ PyThread_allocate_lock(void)
CHECK_STATUS
(
"pthread_cond_init"
);
if
(
error
)
{
f
ree
((
void
*
)
lock
);
PyMem_RawF
ree
((
void
*
)
lock
);
lock
=
0
;
}
}
...
...
@@ -457,7 +457,7 @@ PyThread_free_lock(PyThread_type_lock lock)
status
=
pthread_mutex_destroy
(
&
thelock
->
mut
);
CHECK_STATUS
(
"pthread_mutex_destroy"
);
f
ree
((
void
*
)
thelock
);
PyMem_RawF
ree
((
void
*
)
thelock
);
}
PyLockStatus
...
...
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