(self)
| 273 | (which can be acquired and released from different threads). |
| 274 | """ |
| 275 | def test_reacquire(self): |
| 276 | # Lock needs to be released before re-acquiring. |
| 277 | lock = self.locktype() |
| 278 | phase = [] |
| 279 | |
| 280 | def f(): |
| 281 | lock.acquire() |
| 282 | phase.append(None) |
| 283 | lock.acquire() |
| 284 | phase.append(None) |
| 285 | |
| 286 | with threading_helper.wait_threads_exit(): |
| 287 | # Thread blocked on lock.acquire() |
| 288 | start_new_thread(f, ()) |
| 289 | self.wait_phase(phase, 1) |
| 290 | |
| 291 | # Thread unblocked |
| 292 | lock.release() |
| 293 | self.wait_phase(phase, 2) |
| 294 | |
| 295 | def test_different_thread(self): |
| 296 | # Lock can be released from a different thread. |
nothing calls this directly
no test coverage detected