Bug 1728849 - Protect l10nregistry sources with mutex; r=platform-i18n-reviewers...
commitcbc20fad2b1fc3f3421ce04af3a323965c1baac1
authorDan Minor <dminor@mozilla.com>
Mon, 28 Mar 2022 13:54:36 +0000 (28 13:54 +0000)
committerDan Minor <dminor@mozilla.com>
Mon, 28 Mar 2022 13:54:36 +0000 (28 13:54 +0000)
tree566b91bb7ad6360a74421a6fa23de19b4700d446
parent4e4f917a3012fc66c4c12cae489fb7a70fca3933
Bug 1728849 - Protect l10nregistry sources with mutex; r=platform-i18n-reviewers,gregtatum

This changes from using RefCell to Mutex. RefCell is suitable for
single-threaded applications, but we are seeing concurrent access here
leading to crashes when the sources are mutated at the same time that
bundles are being generated.

This appears to have a minimal effect on the criterion benchmarks. Most of the
results are within +/- 2.0% of the baseline, with a few slower (worst is 9%
slower) and a few faster (best is 7% faster).

Differential Revision: https://phabricator.services.mozilla.com/D140053
intl/l10n/rust/l10nregistry-rs/src/registry/mod.rs