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

Fix to exception raised by Callable in call_once #127

Merged
merged 2 commits into from Oct 9, 2022
Merged

Fix to exception raised by Callable in call_once #127

merged 2 commits into from Oct 9, 2022

Conversation

3246251196
Copy link
Contributor

@3246251196 3246251196 commented Oct 5, 2022

Based on MorphOS implementation: catch the potential exception in Callable, and when doing so, reset the flag allowing other threads calling the same callable to complete Callable.

Not extensive testing, only the code/test in https://en.cppreference.com/w/cpp/thread/call_once which was previously causing thread (Amiga Task) to become stuck waiting for the release of the shared resource (call_once flag).

== PS: Just updated this initial comment because a lot of detail was there explaining how you have to patch gthr-amiga-native.cpp which we no longer need to do since we have updated to 54.16 SDK.

@sba1
Copy link
Owner

sba1 commented Oct 9, 2022

Thanks! Can you please add the test also the adtools test folder?

@3246251196
Copy link
Contributor Author

@sba1
Hi, I have added a test, added the expected output and made changes to the makefile. But, I do not have QEMU set up, so I am making those changes blindly.

@sba1 sba1 merged commit 5ec2e2d into sba1:master Oct 9, 2022
@sba1
Copy link
Owner

sba1 commented Oct 9, 2022

Thanks! The test is enough for now. I think that the changes can be squashed with the previous patch that introduces this thread model though. However, this can be done later.

@3246251196
Copy link
Contributor Author

Yes, that would be beneficial because it would then become implicit in previous versions of GCC. at the moment, this is only for GCC11. But, perhaps it is not a bad thing. This patch has not had extensive testing, after a while - if it holds up - we can squash it then.

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.

None yet

2 participants