Skip to content

Commit d104b14

Browse files
committed
UNDER_THE_HOOD.md: add section on debug code.
1 parent 476f3c3 commit d104b14

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

UNDER_THE_HOOD.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -265,19 +265,20 @@ are hard to debug. There is code which I believe is for debugging purposes and
265265
some I have added myself for this purpose. The aim is to ensure that, if an
266266
error causes a coro to be scheduled when it shouldn't be, an exception is
267267
thrown. The alternative is weird, hard to diagnose, behaviour.
268-
These are the instances.
269-
270-
[pend_throw(false)](https://github.com/peterhinch/micropython-lib/blob/f20d89c6aad9443a696561ca2a01f7ef0c8fb302/uasyncio.core/uasyncio/core.py#L119)
271-
[also here](https://github.com/peterhinch/micropython-lib/blob/f20d89c6aad9443a696561ca2a01f7ef0c8fb302/uasyncio.core/uasyncio/core.py#L123)
268+
These are the instances:
269+
[pend_throw(false)](https://github.com/peterhinch/micropython-lib/blob/f20d89c6aad9443a696561ca2a01f7ef0c8fb302/uasyncio.core/uasyncio/core.py#L119)
270+
also [here](https://github.com/peterhinch/micropython-lib/blob/f20d89c6aad9443a696561ca2a01f7ef0c8fb302/uasyncio.core/uasyncio/core.py#L123).
272271
I think the intention here is to throw an exception (exception doesn't inherit
273272
from Exception) if it is scheduled incorrectly. Correct scheduling coutermands
274-
this:
275-
[here](https://github.com/peterhinch/micropython-lib/blob/819562312bae807ce0d01aa8ad36a13c22ba9e40/uasyncio/uasyncio/__init__.py#L97)
276-
[and here](https://github.com/peterhinch/micropython-lib/blob/819562312bae807ce0d01aa8ad36a13c22ba9e40/uasyncio/uasyncio/__init__.py#L114)
277-
The `rdobjmap` and `wrobjmap` dictionary entries are invalidated
273+
this
274+
[here](https://github.com/peterhinch/micropython-lib/blob/819562312bae807ce0d01aa8ad36a13c22ba9e40/uasyncio/uasyncio/__init__.py#L97)
275+
and [here](https://github.com/peterhinch/micropython-lib/blob/819562312bae807ce0d01aa8ad36a13c22ba9e40/uasyncio/uasyncio/__init__.py#L114):
276+
these lines ensures that the exception will not be thrown.
277+
The `rdobjmap` and `wrobjmap` dictionary entries are invalidated
278278
[here](https://github.com/peterhinch/micropython-lib/blob/819562312bae807ce0d01aa8ad36a13c22ba9e40/uasyncio/uasyncio/__init__.py#L91)
279-
[and here](https://github.com/peterhinch/micropython-lib/blob/819562312bae807ce0d01aa8ad36a13c22ba9e40/uasyncio/uasyncio/__init__.py#L101)
279+
and [here](https://github.com/peterhinch/micropython-lib/blob/819562312bae807ce0d01aa8ad36a13c22ba9e40/uasyncio/uasyncio/__init__.py#L101).
280280
This has the same aim: if an attempt is made incorrectly to reschedule them, an
281+
exception is thrown.
281282

282283
# Modifying uasyncio
283284

0 commit comments

Comments
 (0)