Skip to content

Conversation

@chenkaigithub
Copy link
Contributor

@chenkaigithub chenkaigithub commented May 6, 2022

itemsInBags will be different 500 without atomic operation.

Summary

Describe your changes here.

Fixes #8043 (if available)

itemsInBags will be different 500 without atomic operation.
@chenkaigithub chenkaigithub requested a review from a team as a code owner May 6, 2022 15:38
@ghost
Copy link

ghost commented May 6, 2022

Tagging subscribers to this area: @dotnet/area-system-collections
See info in area-owners.md if you want to be subscribed.

Issue Details

itemsInBags will be different 500 without atomic operation.

Summary

Describe your changes here.

Fixes #Issue_Number (if available)

Author: chenkaigithub
Assignees: -
Labels:

area-System.Collections

Milestone: -

@opbld31
Copy link

opbld31 commented May 6, 2022

Docs Build status updates of commit 02192cf:

✅ Validation status: passed

File Status Preview URL Details
snippets/csharp/System.Collections.Concurrent/ConcurrentBag/concbag.cs ✅Succeeded View

For more details, please refer to the build report.

Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.

For any questions, please:

@chenkaigithub chenkaigithub changed the title itemsInBags will be different 500 itemsInBags will be different from 500 May 9, 2022
Copy link
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

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

Thanks for submitting this change @chenkaigithub

Once you make one addition, this is ready merge.

Thanks again!

{
Console.WriteLine(item);
itemsInBag++;
Interlocked.Increment(ref itemsInBag);
Copy link
Member

Choose a reason for hiding this comment

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

This needs the following using statement to compile correctly:

using System.Threading;

Once you add that, we'll :shipit:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you! I updated.

@ghost ghost added the needs-author-action An issue or pull request that requires more info or actions from the author. label May 9, 2022
Add using System.Threading for function used.
@ghost ghost removed the needs-author-action An issue or pull request that requires more info or actions from the author. label May 9, 2022
@opbld31
Copy link

opbld31 commented May 9, 2022

Docs Build status updates of commit a599ce2:

✅ Validation status: passed

File Status Preview URL Details
snippets/csharp/System.Collections.Concurrent/ConcurrentBag/concbag.cs ✅Succeeded View

For more details, please refer to the build report.

Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.

For any questions, please:

@BillWagner BillWagner merged commit e62cf19 into dotnet:main May 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants