| Age | Commit message (Collapse) | Author |
|
So they are guaranteed to be inlined within functions like
mp_sched_schedule which may be located in a special memory region.
|
|
So ports can put it in a special memory section if needed.
|
|
And add a test that shows how this can happen when multiple threads are
accessing the scheduler, which fails if atomic sections are not used.
|
|
Because the atomic section starts after checking whether the scheduler
state is pending, it's possible it can become a different state by the time
the atomic section starts.
This is especially likely on ports where MICROPY_BEGIN_ATOMIC_SECTION is
implemented with a mutex (i.e. it might block), but the race exists
regardless, i.e. if a context switch occurs between those two lines.
|
|
This is a more logical place to clear the KeyboardInterrupt traceback,
right before it is set as a pending exception. The clearing is also
optimised from a function call to a simple store of NULL.
|
|
Functions like mp_keyboard_interrupt() may need to be called from an IRQ
handler and may need to be in a special memory section, so provide a
generic wrapping macro for a port to do this. The macro name is chosen to
be MICROPY_WRAP_<function name in uppercase> so that (in the future with
more wrappers) each function could potentially be handled separately.
|
|
This function is tightly coupled to the state and behaviour of the
scheduler, and is a core part of the runtime: to schedule a pending
exception. So move it there.
|
|
Previous behaviour is when this argument is set to "true", in which case
the function will raise any pending exception. Setting it to "false" will
cancel any pending exception.
|
|
Behaviour was changed from stack to queue in
8977c7eb581f5d06500edb1ea29aea5cbda04f28, and this updates variable names
to match. Also updates other references (docs, error messages).
|
|
This means the schedule operates on a first-in, first-executed manner
rather than the current last-in, first executed.
|
|
|