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
bb9593af
Kaydet (Commit)
bb9593af
authored
Mar 06, 2019
tarafından
Davide Rizzo
Kaydeden (comit)
Benjamin Peterson
Mar 06, 2019
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
closes bpo-36139: release GIL around munmap(). (GH-12073)
üst
b71e28ea
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
12 deletions
+24
-12
2019-03-06-13-07-29.bpo-36139.6kedum.rst
...S.d/next/Library/2019-03-06-13-07-29.bpo-36139.6kedum.rst
+1
-0
mmapmodule.c
Modules/mmapmodule.c
+23
-12
No files found.
Misc/NEWS.d/next/Library/2019-03-06-13-07-29.bpo-36139.6kedum.rst
0 → 100644
Dosyayı görüntüle @
bb9593af
Release GIL when closing :class:`~mmap.mmap` objects.
Modules/mmapmodule.c
Dosyayı görüntüle @
bb9593af
...
@@ -117,6 +117,7 @@ typedef struct {
...
@@ -117,6 +117,7 @@ typedef struct {
static
void
static
void
mmap_object_dealloc
(
mmap_object
*
m_obj
)
mmap_object_dealloc
(
mmap_object
*
m_obj
)
{
{
Py_BEGIN_ALLOW_THREADS
#ifdef MS_WINDOWS
#ifdef MS_WINDOWS
if
(
m_obj
->
data
!=
NULL
)
if
(
m_obj
->
data
!=
NULL
)
UnmapViewOfFile
(
m_obj
->
data
);
UnmapViewOfFile
(
m_obj
->
data
);
...
@@ -135,6 +136,7 @@ mmap_object_dealloc(mmap_object *m_obj)
...
@@ -135,6 +136,7 @@ mmap_object_dealloc(mmap_object *m_obj)
munmap
(
m_obj
->
data
,
m_obj
->
size
);
munmap
(
m_obj
->
data
,
m_obj
->
size
);
}
}
#endif
/* UNIX */
#endif
/* UNIX */
Py_END_ALLOW_THREADS
if
(
m_obj
->
weakreflist
!=
NULL
)
if
(
m_obj
->
weakreflist
!=
NULL
)
PyObject_ClearWeakRefs
((
PyObject
*
)
m_obj
);
PyObject_ClearWeakRefs
((
PyObject
*
)
m_obj
);
...
@@ -157,28 +159,37 @@ mmap_close_method(mmap_object *self, PyObject *unused)
...
@@ -157,28 +159,37 @@ mmap_close_method(mmap_object *self, PyObject *unused)
again.
again.
TODO - should we check for errors in the close operations???
TODO - should we check for errors in the close operations???
*/
*/
if
(
self
->
data
!=
NULL
)
{
HANDLE
map_handle
=
self
->
map_handle
;
UnmapViewOfFile
(
self
->
data
);
HANDLE
file_handle
=
self
->
file_handle
;
char
*
data
=
self
->
data
;
self
->
map_handle
=
NULL
;
self
->
file_handle
=
INVALID_HANDLE_VALUE
;
self
->
data
=
NULL
;
self
->
data
=
NULL
;
Py_BEGIN_ALLOW_THREADS
if
(
data
!=
NULL
)
{
UnmapViewOfFile
(
data
);
}
}
if
(
self
->
map_handle
!=
NULL
)
{
if
(
map_handle
!=
NULL
)
{
CloseHandle
(
self
->
map_handle
);
CloseHandle
(
map_handle
);
self
->
map_handle
=
NULL
;
}
}
if
(
self
->
file_handle
!=
INVALID_HANDLE_VALUE
)
{
if
(
file_handle
!=
INVALID_HANDLE_VALUE
)
{
CloseHandle
(
self
->
file_handle
);
CloseHandle
(
file_handle
);
self
->
file_handle
=
INVALID_HANDLE_VALUE
;
}
}
Py_END_ALLOW_THREADS
#endif
/* MS_WINDOWS */
#endif
/* MS_WINDOWS */
#ifdef UNIX
#ifdef UNIX
i
f
(
0
<=
self
->
fd
)
i
nt
fd
=
self
->
fd
;
(
void
)
close
(
self
->
fd
)
;
char
*
data
=
self
->
data
;
self
->
fd
=
-
1
;
self
->
fd
=
-
1
;
if
(
self
->
data
!=
NULL
)
{
munmap
(
self
->
data
,
self
->
size
);
self
->
data
=
NULL
;
self
->
data
=
NULL
;
Py_BEGIN_ALLOW_THREADS
if
(
0
<=
fd
)
(
void
)
close
(
fd
);
if
(
data
!=
NULL
)
{
munmap
(
data
,
self
->
size
);
}
}
Py_END_ALLOW_THREADS
#endif
#endif
Py_RETURN_NONE
;
Py_RETURN_NONE
;
...
...
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