Thread safety
- Dominant language
- Rust
- Stars
- 140
- Forks
- 34
- Avg merge
- 5h 5m
- Merged PRs (30d)
- 4
Description
According to https://unicode-org.github.io/icu/userguide/icu/design.html#thread-safe-const-apis, using the methods that take a const this pointer is thread safe.
In my case I'd like to use UCollator across multiple threads, which should be safe since `ucol_strcoll` takes a const pointer, but I can't because it's not Sync+Send. I've looked at the source of rust_icu_ucol, and all the methods that take a non-const pointer in C are `&mut self` in Rust, except for `set_attribute`, which is generated by the `generalized_fallible_setter` macro. If `generalized_fallible_setter` is fixed to generate `&mut self`, would it be safe to mark UCollator (and other service objects, assuming the same is true for their methods) as Sync (edit: and Send)?
Contributor guide
Assessment
This issue has not been assessed yet.