| 121 | # This manages nested uc_emu_start calls and is designed as a friend |
| 122 | # class of MultiTaskUnicorn. |
| 123 | class NestedCounter: |
| 124 | |
| 125 | def __init__(self, mtuc: "MultiTaskUnicorn"): |
| 126 | self._mtuc = mtuc |
| 127 | |
| 128 | def __enter__(self, *args, **kwargs): |
| 129 | self._mtuc._nested_started += 1 |
| 130 | return self |
| 131 | |
| 132 | def __exit__(self, *args, **kwargs): |
| 133 | self._mtuc._nested_started -= 1 |
| 134 | |
| 135 | |
| 136 | # This mimic a Unicorn object by maintaining the same interface. |
no outgoing calls
no test coverage detected