| 2694 | |
| 2695 | |
| 2696 | class _Atomic: |
| 2697 | __slots__ = ('_acquired',) |
| 2698 | |
| 2699 | def __init__(self): |
| 2700 | self._acquired = 0 |
| 2701 | |
| 2702 | def __enter__(self): |
| 2703 | if self._acquired: |
| 2704 | raise exceptions.InterfaceError( |
| 2705 | 'cannot perform operation: another operation is in progress') |
| 2706 | self._acquired = 1 |
| 2707 | |
| 2708 | def __exit__(self, t, e, tb): |
| 2709 | self._acquired = 0 |
| 2710 | |
| 2711 | |
| 2712 | class _ConnectionProxy: |