I am looking at the Tivi repository (chrisbanes/tivi) and notice that they use a Mutex to update a M...
a
I am looking at the Tivi repository (chrisbanes/tivi) and notice that they use a Mutex to update a MutableStateFlow. Isn't it the case that MutableStateflow.update is already threa-safe?
y
Only if it used
_messages.update {}
. Probably worth a PR to remove the mutex and use update. https://github.com/chrisbanes/tivi/blob/0d01352c871cd559e429cf3cba31bf662e8d2f8e/common/ui/view/src/main/java/app/tivi/api/UiMessage.kt#L52