stmhal/pendsv: Disable interrupts during a thread switch.
stmhal/pendsv: Disable interrupts during a thread switch.

We can actually handle interrupts during a thread switch (because we always
have a valid stack), but only if those interrupts don't access any of the
thread state (because the state may not correspond to the stack pointer).
So to be on the safe side we disable interrupts during the very short
period of the thread state+stack switch.

HenrikSolver/micropython,SHA2017-badge/micropython-esp32,AriZuu/micropython,micropython/micropython-esp32,ryannathans/micropython,puuu/micropython,SHA2017-badge/micropython-esp32,pfalcon/micropython,blazewicz/micropython,pfalcon/micropython,henriknelson/micropython,selste/micropython,toolmacher/micropython,pozetroninc/micropython,tobbad/micropython,cwyark/micropython,deshipu/micropython,blazewicz/micropython,cwyark/micropython,toolmacher/micropython,pozetroninc/micropython,MrSurly/micropython-esp32,hiway/micropython,pramasoul/micropython,pramasoul/micropython,blazewicz/micropython,TDAbboud/micropython,tobbad/micropython,PappaPeppar/micropython,Peetz0r/micropython-esp32,adafruit/circuitpython,TDAbboud/micropython,pozetroninc/micropython,pozetroninc/micropython,AriZuu/micropython,adafruit/circuitpython,AriZuu/micropython,deshipu/micropython,pfalcon/micropython,MrSurly/micropython,trezor/micropython,torwag/micropython,chrisdearman/micropython,henriknelson/micropython,alex-robbins/micropython,chrisdearman/micropython,alex-robbins/micropython,ryannathans/micropython,adafruit/circuitpython,toolmacher/micropython,adafruit/micropython,blazewicz/micropython,TDAbboud/micropython,hiway/micropython,ryannathans/micropython,micropython/micropython-esp32,Timmenem/micropython,tralamazza/micropython,henriknelson/micropython,MrSurly/micropython,kerneltask/micropython,alex-robbins/micropython,oopy/micropython,MrSurly/micropython,trezor/micropython,ryannathans/micropython,cwyark/micropython,swegener/micropython,adafruit/micropython,selste/micropython,Peetz0r/micropython-esp32,deshipu/micropython,MrSurly/micropython-esp32,torwag/micropython,trezor/micropython,blazewicz/micropython,torwag/micropython,selste/micropython,torwag/micropython,oopy/micropython,cwyark/micropython,oopy/micropython,chrisdearman/micropython,swegener/micropython,bvernoux/micropython,infinnovation/micropython,adafruit/circuitpython,MrSurly/micropython-esp32,dmazzella/micropython,HenrikSolver/micropython,hiway/micropython,ryannathans/micropython,lowRISC/micropython,lowRISC/micropython,TDAbboud/micropython,deshipu/micropython,Peetz0r/micropython-esp32,Timmenem/micropython,pozetroninc/micropython,pfalcon/micropython,HenrikSolver/micropython,swegener/micropython,selste/micropython,PappaPeppar/micropython,lowRISC/micropython,lowRISC/micropython,AriZuu/micropython,AriZuu/micropython,MrSurly/micropython,henriknelson/micropython,hiway/micropython,bvernoux/micropython,tobbad/micropython,SHA2017-badge/micropython-esp32,chrisdearman/micropython,MrSurly/micropython-esp32,infinnovation/micropython,selste/micropython,hiway/micropython,PappaPeppar/micropython,puuu/micropython,MrSurly/micropython,Timmenem/micropython,adafruit/circuitpython,oopy/micropython,kerneltask/micropython,pramasoul/micropython,adafruit/micropython,tobbad/micropython,HenrikSolver/micropython,PappaPeppar/micropython,bvernoux/micropython,pramasoul/micropython,TDAbboud/micropython,dmazzella/micropython,cwyark/micropython,SHA2017-badge/micropython-esp32,dmazzella/micropython,bvernoux/micropython,kerneltask/micropython,torwag/micropython,tralamazza/micropython,bvernoux/micropython,micropython/micropython-esp32,puuu/micropython,dmazzella/micropython,oopy/micropython,micropython/micropython-esp32,tralamazza/micropython,deshipu/micropython,puuu/micropython,toolmacher/micropython,chrisdearman/micropython,swegener/micropython,toolmacher/micropython,swegener/micropython,pramasoul/micropython,trezor/micropython,Peetz0r/micropython-esp32,adafruit/micropython,infinnovation/micropython,Timmenem/micropython,HenrikSolver/micropython,alex-robbins/micropython,MrSurly/micropython-esp32,trezor/micropython,puuu/micropython,kerneltask/micropython,alex-robbins/micropython,PappaPeppar/micropython,SHA2017-badge/micropython-esp32,henriknelson/micropython,adafruit/micropython,adafruit/circuitpython,lowRISC/micropython,pfalcon/micropython,Timmenem/micropython,tralamazza/micropython,infinnovation/micropython,kerneltask/micropython,tobbad/micropython,Peetz0r/micropython-esp32,infinnovation/micropython,micropython/micropython-esp32