The current bindings are not thread (or embedded tasks) safe. Everything is !Send & !Sync.
Here's how we could have an implementation that could be thread safe:
Create a trait that abstracts over Mutex and Refcell. Implement this trait for Refcell, std::sync::Mutex, critical-section based implementation and the rtic mutex (with the relevant feature flags).
Allow downstreams to implement and provide their own mutexes.
Switch all Refcell usage to this Mutex, this should make everything thread-safe I think.
The current bindings are not thread (or embedded tasks) safe. Everything is
!Send&!Sync.Here's how we could have an implementation that could be thread safe:
Create a trait that abstracts over
MutexandRefcell. Implement this trait forRefcell,std::sync::Mutex,critical-sectionbased implementation and therticmutex (with the relevant feature flags).Allow downstreams to implement and provide their own mutexes.
Switch all
Refcellusage to this Mutex, this should make everything thread-safe I think.