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

checker: allow pass array as mut param to spawn fn #21283

Merged
merged 2 commits into from
Apr 24, 2024

Conversation

felipensp
Copy link
Member

Fix #21280

@JalonSolov
Copy link
Contributor

The only problem with making this work, is that it makes V less safe. If multiple threads start modifying arrays at the same time, it could wreak all sorts of havok... the least being that it can cause very hard to debug issues, since they won't hit unless multiple threads beat on the array at the same time.

@Eliyaan
Copy link
Contributor

Eliyaan commented Apr 15, 2024

But this seem to already work with structs so a choice is to be made

@felipensp felipensp marked this pull request as ready for review April 17, 2024 11:41
@spytheman
Copy link
Member

@medvednikov what do you think?

@medvednikov
Copy link
Member

it does work for structs, so i think it should be allowed

we need to implement a way to catch such bugs (ownership? lol)

@spytheman spytheman merged commit be90cf3 into vlang:master Apr 24, 2024
56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

spawn a function with mut array not allowed
5 participants