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
eeb51a99
Kaydet (Commit)
eeb51a99
authored
May 04, 2009
tarafından
Gregory P. Smith
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
cleanup applied patch to match style that is already in py3k branch.
üst
d02eedac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
15 deletions
+8
-15
_hashopenssl.c
Modules/_hashopenssl.c
+8
-15
No files found.
Modules/_hashopenssl.c
Dosyayı görüntüle @
eeb51a99
...
...
@@ -20,18 +20,15 @@
#ifdef WITH_THREAD
#include "pythread.h"
#define ENTER_HASHLIB(obj) \
if ((obj)->lock) \
{ \
if (!PyThread_acquire_lock((obj)->lock, 0)) \
{ \
if ((obj)->lock) { \
if (!PyThread_acquire_lock((obj)->lock, 0)) { \
Py_BEGIN_ALLOW_THREADS \
PyThread_acquire_lock((obj)->lock, 1); \
Py_END_ALLOW_THREADS \
} \
}
#define LEAVE_HASHLIB(obj) \
if ((obj)->lock) \
{ \
if ((obj)->lock) { \
PyThread_release_lock((obj)->lock); \
}
#else
...
...
@@ -230,14 +227,12 @@ EVP_update(EVPobject *self, PyObject *args)
GET_BUFFER_VIEW_OR_ERROUT
(
obj
,
&
view
,
NULL
);
#ifdef WITH_THREAD
if
(
self
->
lock
==
NULL
&&
view
.
len
>=
HASHLIB_GIL_MINSIZE
)
{
if
(
self
->
lock
==
NULL
&&
view
.
len
>=
HASHLIB_GIL_MINSIZE
)
{
self
->
lock
=
PyThread_allocate_lock
();
/* fail? lock = NULL and we fail over to non-threaded code. */
}
if
(
self
->
lock
!=
NULL
)
{
if
(
self
->
lock
!=
NULL
)
{
Py_BEGIN_ALLOW_THREADS
PyThread_acquire_lock
(
self
->
lock
,
1
);
EVP_hash
(
self
,
view
.
buf
,
view
.
len
);
...
...
@@ -352,14 +347,13 @@ EVP_tp_init(EVPobject *self, PyObject *args, PyObject *kwds)
Py_INCREF
(
self
->
name
);
if
(
data_obj
)
{
if
(
view
.
len
>=
HASHLIB_GIL_MINSIZE
)
{
if
(
view
.
len
>=
HASHLIB_GIL_MINSIZE
)
{
Py_BEGIN_ALLOW_THREADS
EVP_hash
(
self
,
view
.
buf
,
view
.
len
);
Py_END_ALLOW_THREADS
}
else
{
EVP_hash
(
self
,
view
.
buf
,
view
.
len
);
}
}
PyBuffer_Release
(
&
view
);
}
...
...
@@ -450,8 +444,7 @@ EVPnew(PyObject *name_obj,
}
if
(
cp
&&
len
)
{
if
(
len
>=
HASHLIB_GIL_MINSIZE
)
{
if
(
len
>=
HASHLIB_GIL_MINSIZE
)
{
Py_BEGIN_ALLOW_THREADS
EVP_hash
(
self
,
cp
,
len
);
Py_END_ALLOW_THREADS
...
...
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