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
c2824d41
Kaydet (Commit)
c2824d41
authored
Nis 24, 2011
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #11915: threading.RLock()._release_save() raises a RuntimeError if the
lock was not acquired.
üst
a82aa55b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
0 deletions
+13
-0
lock_tests.py
Lib/test/lock_tests.py
+2
-0
threading.py
Lib/threading.py
+2
-0
NEWS
Misc/NEWS
+3
-0
_threadmodule.c
Modules/_threadmodule.c
+6
-0
No files found.
Lib/test/lock_tests.py
Dosyayı görüntüle @
c2824d41
...
@@ -247,6 +247,7 @@ class RLockTests(BaseLockTests):
...
@@ -247,6 +247,7 @@ class RLockTests(BaseLockTests):
# Cannot release an unacquired lock
# Cannot release an unacquired lock
lock
=
self
.
locktype
()
lock
=
self
.
locktype
()
self
.
assertRaises
(
RuntimeError
,
lock
.
release
)
self
.
assertRaises
(
RuntimeError
,
lock
.
release
)
self
.
assertRaises
(
RuntimeError
,
lock
.
_release_save
)
lock
.
acquire
()
lock
.
acquire
()
lock
.
acquire
()
lock
.
acquire
()
lock
.
release
()
lock
.
release
()
...
@@ -254,6 +255,7 @@ class RLockTests(BaseLockTests):
...
@@ -254,6 +255,7 @@ class RLockTests(BaseLockTests):
lock
.
release
()
lock
.
release
()
lock
.
release
()
lock
.
release
()
self
.
assertRaises
(
RuntimeError
,
lock
.
release
)
self
.
assertRaises
(
RuntimeError
,
lock
.
release
)
self
.
assertRaises
(
RuntimeError
,
lock
.
_release_save
)
def
test_different_thread
(
self
):
def
test_different_thread
(
self
):
# Cannot release from a different thread
# Cannot release from a different thread
...
...
Lib/threading.py
Dosyayı görüntüle @
c2824d41
...
@@ -157,6 +157,8 @@ class _RLock(_Verbose):
...
@@ -157,6 +157,8 @@ class _RLock(_Verbose):
def
_release_save
(
self
):
def
_release_save
(
self
):
if
__debug__
:
if
__debug__
:
self
.
_note
(
"
%
s._release_save()"
,
self
)
self
.
_note
(
"
%
s._release_save()"
,
self
)
if
self
.
_count
==
0
:
raise
RuntimeError
(
"cannot release un-acquired lock"
)
count
=
self
.
_count
count
=
self
.
_count
self
.
_count
=
0
self
.
_count
=
0
owner
=
self
.
_owner
owner
=
self
.
_owner
...
...
Misc/NEWS
Dosyayı görüntüle @
c2824d41
...
@@ -113,6 +113,9 @@ Core and Builtins
...
@@ -113,6 +113,9 @@ Core and Builtins
Library
Library
-------
-------
-
Issue
#
11915
:
threading
.
RLock
().
_release_save
()
raises
a
RuntimeError
if
the
lock
was
not
acquired
.
-
Issue
#
11258
:
Speed
up
ctypes
.
util
.
find_library
()
under
Linux
by
a
factor
-
Issue
#
11258
:
Speed
up
ctypes
.
util
.
find_library
()
under
Linux
by
a
factor
of
5
to
10.
Initial
patch
by
Jonas
H
.
of
5
to
10.
Initial
patch
by
Jonas
H
.
...
...
Modules/_threadmodule.c
Dosyayı görüntüle @
c2824d41
...
@@ -414,6 +414,12 @@ rlock_release_save(rlockobject *self)
...
@@ -414,6 +414,12 @@ rlock_release_save(rlockobject *self)
long
owner
;
long
owner
;
unsigned
long
count
;
unsigned
long
count
;
if
(
self
->
rlock_count
==
0
)
{
PyErr_SetString
(
PyExc_RuntimeError
,
"cannot release un-acquired lock"
);
return
NULL
;
}
owner
=
self
->
rlock_owner
;
owner
=
self
->
rlock_owner
;
count
=
self
->
rlock_count
;
count
=
self
->
rlock_count
;
self
->
rlock_count
=
0
;
self
->
rlock_count
=
0
;
...
...
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