mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
845bbc293a
Having two different spinlocks is problematic due to possibly different order in which the locks will be taken. Changing the order would require significant restructuring of kernel code which is undesirable. An additional place where taking xTickCountMutex was needed was in vApplicationSleep function. Not taking xTickCountMutex resulted in other CPU sometimes possibly advancing tick count while light sleep entry/exit was happening. Taking xTickCountMutex in addition to xTaskQueueMutex has shown a problem that in different code paths, these two spinlocks could be taken in different order, leading to (unlikely, but possible) deadlocks.