Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - Use correct terminology for a NonSend run condition panic #7841

Closed
wants to merge 2 commits into from

Conversation

JoJoJet
Copy link
Member

@JoJoJet JoJoJet commented Feb 28, 2023

Objective

There is a panic that occurs when creating a run condition that accesses NonSend resources, but it refers to them as 'thread-local' resources instead.

Solution

Correct the terminology.

@JoJoJet JoJoJet added A-ECS Entities, components, systems, and events C-Code-Quality A section of code that is hard to understand or change labels Feb 28, 2023
Comment on lines 59 to 63
assert!(
condition_system.is_send(),
"Condition `{}` accesses thread-local resources. This is not currently supported.",
"Condition `{}` accesses `NonSend` resources. This is not currently supported.",
condition_system.name()
);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to note that this assert currently does nothing, since a system's "send-ness" only gets set when it's initialized. This assert never gets triggered, so instead a panic occurs later on when the system actually tries to access a NonSend resource from the wrong thread. I'm not sure what the best solution to this is, but it's probably worth opening an issue about it.

Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow it's from like Bevy 0.2!

@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Feb 28, 2023
@alice-i-cecile
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Feb 28, 2023
# Objective

There is a panic that occurs when creating a run condition that accesses `NonSend` resources, but it refers to them as 'thread-local' resources instead.

## Solution

Correct the terminology.
@bors bors bot changed the title Use correct terminology for a NonSend run condition panic [Merged by Bors] - Use correct terminology for a NonSend run condition panic Feb 28, 2023
@bors bors bot closed this Feb 28, 2023
@JoJoJet JoJoJet deleted the correct-terminology branch February 28, 2023 14:14
Shfty pushed a commit to shfty-rust/bevy that referenced this pull request Mar 19, 2023
…ne#7841)

# Objective

There is a panic that occurs when creating a run condition that accesses `NonSend` resources, but it refers to them as 'thread-local' resources instead.

## Solution

Correct the terminology.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events C-Code-Quality A section of code that is hard to understand or change S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants