bevy/crates/bevy_utils/src
PROMETHIA-27 05afbc6815 Remove Sync bound from Local (#5483)
# Objective

Currently, `Local` has a `Sync` bound. Theoretically this is unnecessary as a local can only ever be accessed from its own system, ensuring exclusive access on one thread. This PR removes this restriction.

## Solution

- By removing the `Resource` bound from `Local` and adding the new `SyncCell` threading primative, `Local` can have the `Sync` bound removed.

## Changelog

### Added

- Added `SyncCell` to `bevy_utils`

### Changed

- Removed `Resource` bound from `Local`
- `Local` is now wrapped in a `SyncCell`

## Migration Guide

- Any code relying on `Local<T>` having `T: Resource` may have to be changed, but this is unlikely.

Co-authored-by: PROMETHIA-27 <42193387+PROMETHIA-27@users.noreply.github.com>
2022-09-12 04:15:55 +00:00
..
default.rs default() shorthand (#4071) 2022-03-01 20:52:09 +00:00
float_ord.rs Document That FloatOrd Implements Hash and Eq Too (#5228) 2022-07-11 14:11:27 +00:00
futures.rs add more SAFETY comments and lint for missing ones in bevy_ecs (#4835) 2022-07-04 14:44:24 +00:00
label.rs improve documentation for macro-generated label types (#5367) 2022-07-20 19:39:42 +00:00
lib.rs Remove Sync bound from Local (#5483) 2022-09-12 04:15:55 +00:00
short_names.rs Move get_short_name utility method from bevy_reflect into bevy_utils (#5174) 2022-07-02 18:30:45 +00:00
synccell.rs Remove Sync bound from Local (#5483) 2022-09-12 04:15:55 +00:00