diff options
author | David Lechner <david@pybricks.com> | 2020-01-22 23:54:38 -0600 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2020-03-27 14:40:46 +1100 |
commit | 9418611c8aa860812e28b6e2b6bfde7be5817b43 (patch) | |
tree | 5e42c1510ea143c8b279641dbae5e1b178edf5b4 /tests/micropython/heapalloc_fail_memoryview.py | |
parent | 5e6cee07aba4fd73c13024f091a287171bea1f17 (diff) |
unix: Implement PEP 475 to retry syscalls failing with EINTR.
https://www.python.org/dev/peps/pep-0475/
This implements something similar to PEP 475 on the unix port, and for the
VfsPosix class.
There are a few differences from the CPython implementation:
- Since we call mp_handle_pending() between any ENITR's, additional
functions could be called if MICROPY_ENABLE_SCHEDULER is enabled, not
just signal handlers.
- CPython only handles signal on the main thread, so other threads will
raise InterruptedError instead of retrying. On MicroPython,
mp_handle_pending() will currently raise exceptions on any thread.
A new macro MP_HAL_RETRY_SYSCALL is introduced to reduce duplicated code
and ensure that all instances behave the same. This will also allow other
ports that use POSIX-like system calls (and use, eg, VfsPosix) to provide
their own implementation if needed.
Diffstat (limited to 'tests/micropython/heapalloc_fail_memoryview.py')
0 files changed, 0 insertions, 0 deletions