-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert the todolist example to be threadsafe. (#422)
For demonstration purposes we mark the interface as threadsafe, meaning we need to drop all `&mut self` functions and wrap `self.items` in a suitable wrapper - `RwLock` in this case. This is done in support of [ADR-0004]( https://github.com/mozilla/uniffi-rs/blob/main/docs/adr/0004-only-threadsafe-interfaces.md), which will contain a link to this PR/commit to show an example of the kind of modifications interfaces need to become threadsafe.
- Loading branch information
Showing
2 changed files
with
36 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters