Skip to content

Commit 59d07fa

Browse files
committed
Test locking RLock recursively
1 parent 5bfdbc7 commit 59d07fa

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Lib/test/test_threading.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,6 +1261,8 @@ def test_acquire_daemon_thread_lock_in_finalization(self, lock_class_name):
12611261
12621262
lock = threading.{lock_class_name}()
12631263
def loop():
1264+
if {lock_class_name!r} == 'RLock':
1265+
lock.acquire()
12641266
with lock:
12651267
thread_started_event.set()
12661268
while True:
@@ -1281,6 +1283,8 @@ def __del__(self):
12811283
12821284
# We *can* acquire an unlocked lock
12831285
uncontested_lock.acquire()
1286+
if {lock_class_name!r} == 'RLock':
1287+
uncontested_lock.acquire()
12841288
12851289
# Acquiring a locked one fails
12861290
try:

0 commit comments

Comments
 (0)