like pipeline() but don't acquire a lock. Assume that the caller is holding the lock.
(self)
| 454 | |
| 455 | @contextmanager |
| 456 | def _pipeline_nolock(self) -> Iterator[Pipeline]: |
| 457 | """like pipeline() but don't acquire a lock. |
| 458 | |
| 459 | Assume that the caller is holding the lock. |
| 460 | """ |
| 461 | |
| 462 | # Currently only used internally by Cursor.executemany() in a branch |
| 463 | # in which we already established that the connection has no pipeline. |
| 464 | # If this changes we may relax the asserts. |
| 465 | assert not self._pipeline |
| 466 | # WARNING: reference loop, broken ahead. |
| 467 | pipeline = self._pipeline = Pipeline(self, _no_lock=True) |
| 468 | try: |
| 469 | with pipeline: |
| 470 | yield pipeline |
| 471 | finally: |
| 472 | assert pipeline.level == 0 |
| 473 | assert pipeline is self._pipeline |
| 474 | self._pipeline = None |
| 475 | |
| 476 | def wait(self, gen: PQGen[RV], interval: float = _WAIT_INTERVAL) -> RV: |
| 477 | """ |
no test coverage detected