diff options
| author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-11-12 17:53:18 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-12 17:53:18 +0000 |
| commit | 98f0a9610401ec09709dd3dc4bd8b3f0a0c50be6 (patch) | |
| tree | 944a6fb5e17153439a6d74030b28e9faea6bd708 /book | |
| parent | c6a8477b9b0a9f848f5308b670cf335bd98f6590 (diff) | |
| parent | 0a578c76ca178467ef033dfdab20ee407d8394cd (diff) | |
Merge #409
409: Updated send/sync docs r=AfoHT a=korken89
Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
Diffstat (limited to 'book')
| -rw-r--r-- | book/en/src/by-example/types-send-sync.md | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/book/en/src/by-example/types-send-sync.md b/book/en/src/by-example/types-send-sync.md index 9cdb889..a45f179 100644 --- a/book/en/src/by-example/types-send-sync.md +++ b/book/en/src/by-example/types-send-sync.md @@ -27,31 +27,8 @@ resources. [`Send`]: https://doc.rust-lang.org/core/marker/trait.Send.html The `app` attribute will enforce that `Send` is implemented where required so -you don't need to worry much about it. It's more important to know where you do -*not* need the `Send` trait: on types that are transferred between tasks that -run at the *same* priority. This occurs in two places: in message passing and in -shared resources. - -The example below shows where a type that doesn't implement `Send` can be used. - -``` rust -{{#include ../../../../examples/not-send.rs}} -``` - -It's important to note that late initialization of resources is effectively a -send operation where the initial value is sent from the background context, -which has the lowest priority of `0`, to a task, which will run at a priority -greater than or equal to `1`. Thus all late resources need to implement the -`Send` trait, except for those exclusively accessed by `idle`, which runs at a -priority of `0`. - -Sharing a resource with `init` can be used to implement late initialization, see -example below. For that reason, resources shared with `init` must also implement -the `Send` trait. - -``` rust -{{#include ../../../../examples/shared-with-init.rs}} -``` +you don't need to worry much about it. Currently all types that are passed need +to be `Send` in RTIC, however this restriction might be relaxed in the future. ## `Sync` |
