-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
I personally think CriticalSection
should not be Clone
, because of two use case requiring that:
interrupt::enable_cs
: Safely enable interrupts, consuming a critical section. This can't work if there can be another copy lying around.Mutex::borrow_mut
: I'm quite sure this would allow to mutably borrow data in a mutex, by taking a&mut CriticalSection
. This would only allow to mutably borrow one mutex as once, but I think it is still better thanMutex<RefCell<_>>
.
All actual use cases ought to work by passing a &CriticalSection
, although I don't think this needs to be used often. Should the size of &CriticalSection
be a problem, one could imagine a SharedCriticalSection
ZST borrowing a CriticalSection
.
Metadata
Metadata
Assignees
Labels
No labels