Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@achabense
Copy link
Contributor

Fixes #3748.

@achabense achabense requested a review from a team as a code owner June 9, 2023 17:41
@StephanTLavavej StephanTLavavej added the enhancement Something can be improved label Jun 9, 2023
@StephanTLavavej StephanTLavavej self-assigned this Jun 9, 2023
@StephanTLavavej StephanTLavavej removed their assignment Jun 10, 2023

_NODISCARD_BARRIER_TOKEN arrival_token arrive(ptrdiff_t _Update = 1) noexcept /* strengthened */ {
// Shifting before precondition check, so that exceeding max() will trigger precondition check too
_STL_VERIFY(_Update > 0 && _Update <= (max) (), "Precondition: update > 0 (N4950 [thread.barrier.class]/12)");
Copy link
Contributor Author

@achabense achabense Jun 13, 2023

Choose a reason for hiding this comment

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

Sorry for this late review -- I didn't realize it was "Pending"-ed.

_Update <= max() is necessary, as it avoids large positive value becoming negative after shift. However, this will cause a mismatch between the check and error message. This check is more relevant to the constraint "update <= expected count", but I don't think we should put it off. I have no idea how to make an improvement. Any ideas?

Copy link
Member

Choose a reason for hiding this comment

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

I'm okay with a slightly confusing message here.

@StephanTLavavej StephanTLavavej self-assigned this Jun 14, 2023
@StephanTLavavej
Copy link
Member

I'm speculatively mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit 25a58af into microsoft:main Jun 15, 2023
@StephanTLavavej
Copy link
Member

Thanks for enhancing the Great Galactic Barrier that keeps the Alpha Quadrant safe! 🛡️ 🛸 😹

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Something can be improved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

<barrier>: Some _STL_VERIFYs are not working well

3 participants