The FreeRTOS port for ESP32 disables interrupts upto XCHAL_EXCM_LEVEL priority. So the solution you suggested should be possible to implement on ESP32.
The FreeRTOS port for ESP32 disables interrupts upto XCHAL_EXCM_LEVEL priority. So the solution you suggested should be possible to implement on ESP32.