Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
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
django
Commits
8b5a2980
Kaydet (Commit)
8b5a2980
authored
Eyl 09, 2017
tarafından
Sergey Fedoseev
Kaydeden (comit)
Tim Graham
Eyl 09, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #25961 -- Removed handling of non-thread safe GEOS functions.
üst
63d2472b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
30 deletions
+20
-30
libgeos.py
django/contrib/gis/geos/libgeos.py
+5
-3
threadsafe.py
django/contrib/gis/geos/prototypes/threadsafe.py
+15
-27
No files found.
django/contrib/gis/geos/libgeos.py
Dosyayı görüntüle @
8b5a2980
...
...
@@ -66,6 +66,8 @@ def load_geos():
# geos/prototypes/threadsafe.py.
_lgeos
.
initGEOS_r
.
restype
=
CONTEXT_PTR
_lgeos
.
finishGEOS_r
.
argtypes
=
[
CONTEXT_PTR
]
# Set restype for compatibility across 32 and 64-bit platforms.
_lgeos
.
GEOSversion
.
restype
=
c_char_p
return
_lgeos
...
...
@@ -163,9 +165,9 @@ class GEOSFuncFactory:
return
func
# Return the string version of the GEOS library. Have to set the restype
# explicitly to c_char_p to ensure compatibility across 32 and 64-bit platforms.
geos_version
=
GEOSFuncFactory
(
'GEOSversion'
,
restype
=
c_char_p
)
def
geos_version
():
"""Return the string version of the GEOS library."""
return
lgeos
.
GEOSversion
(
)
def
geos_version_tuple
():
...
...
django/contrib/gis/geos/prototypes/threadsafe.py
Dosyayı görüntüle @
8b5a2980
...
...
@@ -32,29 +32,20 @@ class GEOSFunc:
variants when available.
"""
def
__init__
(
self
,
func_name
):
try
:
# GEOS thread-safe function signatures end with '_r', and
# take an additional context handle parameter.
self
.
cfunc
=
getattr
(
lgeos
,
func_name
+
'_r'
)
self
.
threaded
=
True
# Create a reference here to thread_context so it's not
# garbage-collected before an attempt to call this object.
self
.
thread_context
=
thread_context
except
AttributeError
:
# Otherwise, use usual function.
self
.
cfunc
=
getattr
(
lgeos
,
func_name
)
self
.
threaded
=
False
# GEOS thread-safe function signatures end with '_r' and take an
# additional context handle parameter.
self
.
cfunc
=
getattr
(
lgeos
,
func_name
+
'_r'
)
# Create a reference to thread_context so it's not garbage-collected
# before an attempt to call this object.
self
.
thread_context
=
thread_context
def
__call__
(
self
,
*
args
):
if
self
.
threaded
:
# If a context handle does not exist for this thread, initialize one.
if
not
self
.
thread_context
.
handle
:
self
.
thread_context
.
handle
=
GEOSContextHandle
()
# Call the threaded GEOS routine with pointer of the context handle
# as the first argument.
return
self
.
cfunc
(
self
.
thread_context
.
handle
.
ptr
,
*
args
)
else
:
return
self
.
cfunc
(
*
args
)
# Create a context handle if one doesn't exist for this thread.
if
not
self
.
thread_context
.
handle
:
self
.
thread_context
.
handle
=
GEOSContextHandle
()
# Call the threaded GEOS routine with the pointer of the context handle
# as the first argument.
return
self
.
cfunc
(
self
.
thread_context
.
handle
.
ptr
,
*
args
)
def
__str__
(
self
):
return
self
.
cfunc
.
__name__
...
...
@@ -64,12 +55,9 @@ class GEOSFunc:
return
self
.
cfunc
.
argtypes
def
_set_argtypes
(
self
,
argtypes
):
if
self
.
threaded
:
new_argtypes
=
[
CONTEXT_PTR
]
new_argtypes
.
extend
(
argtypes
)
self
.
cfunc
.
argtypes
=
new_argtypes
else
:
self
.
cfunc
.
argtypes
=
argtypes
new_argtypes
=
[
CONTEXT_PTR
]
new_argtypes
.
extend
(
argtypes
)
self
.
cfunc
.
argtypes
=
new_argtypes
argtypes
=
property
(
_get_argtypes
,
_set_argtypes
)
...
...
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