Closed harlem88 closed 1 year ago
The RWLock is not Sync
(or Send
) without T: Sync
because unlike the mutex you can have multiple shared references &T
at the same time.
An example of this being bad UB is having multiple readers of a RWLock<Cell<T>>
(Cell is not Sync) which will permit different threads to grab a reader &T
and modify the inner T
.
Since most of tonic::Stream
methods are only &mut self
a Mutex is nonetheless the best choice 🙆🏻♂️
Patch coverage: 65.00
% and project coverage change: -1.07
:warning:
Comparison is base (
60c9dd5
) 76.38% compared to head (7b7f346
) 75.32%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
closes #169