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

Passing reference to other threads #6

Closed
eschnett opened this issue May 3, 2021 · 2 comments
Closed

Passing reference to other threads #6

eschnett opened this issue May 3, 2021 · 2 comments

Comments

@eschnett
Copy link

eschnett commented May 3, 2021

Line 108

            push_task([&start, &end, &loop, &blocks_running] {

passes references to start and stop to other threads. These variables are then overwritten in the next iteration, and may even go out of scope when the function finishes. This is undefined behaviour. Instead, the thread should receive copies of these variables.

@bshoshany
Copy link
Owner

Good catch! Thanks for spotting it. I will fix it in v1.3 (to be released tomorrow).

@bshoshany
Copy link
Owner

Closing since this issue is now fixed in v1.3.

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

No branches or pull requests

2 participants