Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Description This PR resolves an issue where invocation of the debugln!() macro could result in deadlock due to contention between two different TPL levels. The deadlock occurs in the following scenario: 1. A task running at a lower TPL invokes debugln!() and acquires the spinlock on the logger object. 2. That task is interrupted by a TPL running at a higher level (the lower task has not released the lock). 3. The higher TPL invokes debugln!(). In this scenario, the higher TPL task cannot make forward progress because it cannot acquire the lock held by the lower TPL task, and the lower TPL task is not executing because it was interrupted by the higher TPL task. This resolves the issue by changing the "lock" to a "try_lock" - in the scenario above, this allows the higher TPL task to make forward progress. This has the downside of dropping the message from the higher TPL task; so this is only intended as an interim fix. - [ ] Impacts functionality? - [ ] Impacts security? - [ ] Breaking change? - [ ] Includes tests? - [ ] Includes documentation? ## How This Was Tested Reproduced the issue using QEMU emulator; with this change the above flow no longer deadlocks. ## Integration Instructions N/A
- Loading branch information