Skip to content

Commit e0ba38c

Browse files
committed
fix(sync): fix the debug printing of Mutex and RecursiveMutex when CPU Lock is active
1 parent e3eae58 commit e0ba38c

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1414
- Upgrade `tokenlock` to `0.3.4`
1515
- Using the new version of `tokenlock`, some atomics-based hacks were removed. This might marginally improve the runtime performance as the compiler is given more leeway to optimize memory accesses.
1616

17+
### Fixed
18+
19+
- The debug printing of `Mutex` and `RecursiveMutex` in an invalid context now produces a message that makes sense.
20+
1721
## [0.1.1] - 2020-12-20
1822

1923
### Added

src/r3/src/sync/mutex.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ impl<System: Kernel, T: fmt::Debug + 'static> fmt::Debug for Mutex<System, T> {
242242
struct BadContextPlaceholder;
243243
impl fmt::Debug for BadContextPlaceholder {
244244
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
245-
f.write_str("<CPU context active>")
245+
f.write_str("<bad context>")
246246
}
247247
}
248248

src/r3/src/sync/recursive_mutex.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ impl<System: Kernel, T: fmt::Debug + 'static> fmt::Debug for RecursiveMutex<Syst
335335
struct BadContextPlaceholder;
336336
impl fmt::Debug for BadContextPlaceholder {
337337
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
338-
f.write_str("<CPU context active>")
338+
f.write_str("<bad context>")
339339
}
340340
}
341341

0 commit comments

Comments
 (0)