You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
zephyr-core: mutex: own the data rather than forcing a reference
The original design worked when both the mutex were static or the
lifetime was known (which doesn't really work if you're sharing across
threads). To share dynamically-allocated data, we need an Arc. So the
mutex needs to either own an Arc, or own the data directly and be
wrapped in an Arc. Forcing data to be a reference is incompatible with
both.
Retain the ability to clone the mutex directly if data is a reference
(most likely static), so we don't have to put two static references in
an Arc on the heap just to be able to share them. The new mutex struct
will keep the lifetime constaints of the original.
0 commit comments