diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2009-11-10 18:46:01 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2009-11-10 18:46:01 (GMT) |
commit | 434736a1a621f785858e58efe682320178de7993 (patch) | |
tree | cbd08641338319c3c8d6c85d3680ee6c8dad279a /Lib/test/test_threading.py | |
parent | 0e31201848f45db86bea6bf5bd196e2db88fbfbe (diff) | |
download | cpython-434736a1a621f785858e58efe682320178de7993.zip cpython-434736a1a621f785858e58efe682320178de7993.tar.gz cpython-434736a1a621f785858e58efe682320178de7993.tar.bz2 |
Issue #3001: Add a C implementation of recursive locks which is used by
default when instantiating a `Threading.RLock` object. This makes
recursive locks as fast as regular non-recursive locks (previously,
they were slower by 10x to 15x).
Diffstat (limited to 'Lib/test/test_threading.py')
-rw-r--r-- | Lib/test/test_threading.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py index 41f57dc..330a2c5 100644 --- a/Lib/test/test_threading.py +++ b/Lib/test/test_threading.py @@ -506,8 +506,11 @@ class ThreadingExceptionTests(BaseTestCase): class LockTests(lock_tests.LockTests): locktype = staticmethod(threading.Lock) -class RLockTests(lock_tests.RLockTests): - locktype = staticmethod(threading.RLock) +class PyRLockTests(lock_tests.RLockTests): + locktype = staticmethod(threading._PyRLock) + +class CRLockTests(lock_tests.RLockTests): + locktype = staticmethod(threading._CRLock) class EventTests(lock_tests.EventTests): eventtype = staticmethod(threading.Event) @@ -527,7 +530,7 @@ class BoundedSemaphoreTests(lock_tests.BoundedSemaphoreTests): def test_main(): - test.support.run_unittest(LockTests, RLockTests, EventTests, + test.support.run_unittest(LockTests, PyRLockTests, CRLockTests, EventTests, ConditionAsRLockTests, ConditionTests, SemaphoreTests, BoundedSemaphoreTests, ThreadTests, |