-
Notifications
You must be signed in to change notification settings - Fork 164
extmod/utimeq.c: queue module supporting the asyncio lib for cooperative multitasking #116
Conversation
Hello, |
I believe utimeq is needed by these libraries: https://github.com/micropython/micropython-lib/tree/master/asyncio_slow |
Sorry, it's actually needed here: https://github.com/micropython/micropython-lib/tree/f0ed97ad23b1ee5f28fc214e264a4740fd32d32b/uasyncio.core |
Yes that's true, I missed it. The change looks good except it crashes if the size of the list passed to the pop() function is smaller than 3 because the mp_raise_TypeError() function is called with NULL value. It should be changed to something: "The list does not exist or too small!" |
extmod/modutimeq.c
Outdated
} | ||
mp_obj_list_t *ret = MP_OBJ_TO_PTR(list_ref); | ||
if (!MP_OBJ_IS_TYPE(list_ref, &mp_type_list) || ret->len < 3) { | ||
mp_raise_TypeError(NULL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NULL must be changed to a valid string because it makes the system crash in this form
extmod/utimeq.c: queue module supporting the asyncio lib for cooperative multitasking
Both the module utimeq.c and the asyncio lib are made by @pfalcon (Paul Sokolovsky). They create support for cooperative multitasking, in contrast to exhaustive multitasking offered by the _thead module. This PR just adds the utimeq.c module to the set of extern modules and aligns the various settings. The asyncio libs themselves requires slight changes too. The major change is caused by the diverging utime module. Some of that is addressed by the PR #115 to the utime module.