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