mirror of https://github.com/rusefi/rusefi-1.git
fix unlock bug (#1384)
This commit is contained in:
parent
b9c4c3636e
commit
4252ed8d78
|
@ -65,6 +65,7 @@ static void perfEventImpl(PE event, EPhase phase)
|
|||
// In addition, if we want to trace lock/unlock events, we can't
|
||||
// be locking ourselves from the trace functionality.
|
||||
{
|
||||
uint32_t prim = __get_PRIMASK();
|
||||
__disable_irq();
|
||||
|
||||
idx = s_nextIdx++;
|
||||
|
@ -73,8 +74,11 @@ static void perfEventImpl(PE event, EPhase phase)
|
|||
s_isTracing = false;
|
||||
}
|
||||
|
||||
// Restore previous interrupt state - don't restore if they weren't enabled
|
||||
if (!prim) {
|
||||
__enable_irq();
|
||||
}
|
||||
}
|
||||
|
||||
// We can safely write data out of the lock, our spot is reserved
|
||||
volatile TraceEntry& entry = s_traceBuffer[idx];
|
||||
|
|
Loading…
Reference in New Issue