(self)
| 164 | |
| 165 | @unittest.skip("TODO: RUSTPYTHON; sometimes hangs") |
| 166 | def test_acquire_contended(self): |
| 167 | lock = self.locktype() |
| 168 | lock.acquire() |
| 169 | def f(): |
| 170 | lock.acquire() |
| 171 | lock.release() |
| 172 | |
| 173 | N = 5 |
| 174 | with Bunch(f, N) as bunch: |
| 175 | # Threads block on lock.acquire() |
| 176 | wait_threads_blocked(N) |
| 177 | self.assertEqual(len(bunch.finished), 0) |
| 178 | |
| 179 | # Threads unblocked |
| 180 | lock.release() |
| 181 | |
| 182 | self.assertEqual(len(bunch.finished), N) |
| 183 | |
| 184 | def test_with(self): |
| 185 | lock = self.locktype() |
nothing calls this directly
no test coverage detected