micropython-lib/micropython
Angus Gratton 1d3c722b7d usb: Fix race if transfers are submitted by a thread.
The USB pending transfer flag was cleared before calling the completion
callback, to allow the callback code to call submit_xfer() again.

Unfortunately this isn't safe in a multi-threaded environment, as another
thread may see the endpoint is available before the callback is done
executing and submit a new transfer.

Rather than adding extra locking, specifically treat the transfer as still
pending if checked from another thread while the callback is executing.

Closes #874

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-09-11 17:13:53 +10:00
..
aioespnow
aiorepl
bluetooth aioble/multitests: Store a reference to tasks and cancel when done. 2024-06-14 10:35:06 +10:00
bundles
drivers all: Use non-u versions of built-in modules. 2024-06-14 10:35:06 +10:00
espflash
lora lora-sx126x: Change to class-level memoryview for _cmd buf. 2024-07-23 15:12:50 +10:00
mip
mip-cmdline
net all: Use non-u versions of built-in modules. 2024-06-14 10:35:06 +10:00
senml
uaiohttpclient
ucontextlib
udnspkt all: Use non-u versions of built-in modules. 2024-06-14 10:35:06 +10:00
umqtt.robust umqtt.robust: Remove reference to missing example. 2024-09-08 22:48:33 +10:00
umqtt.simple all: Use non-u versions of built-in modules. 2024-06-14 10:35:06 +10:00
upysh
urequests
urllib.urequest all: Use non-u versions of built-in modules. 2024-06-14 10:35:06 +10:00
usb usb: Fix race if transfers are submitted by a thread. 2024-09-11 17:13:53 +10:00
xmltok
README.md

README.md

MicroPython-specific packages

These are packages that have been written specifically for use on MicroPython.

Packages in this directory should not have the same name as modules from the Python Standard Library.

Future plans

  • More organised directory structure based on purpose (e.g. drivers, network, etc).