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

AsyncBarrier does not work #73

Closed
ascott18 opened this issue Aug 11, 2021 · 3 comments
Closed

AsyncBarrier does not work #73

ascott18 opened this issue Aug 11, 2021 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@ascott18
Copy link

I can't get AsyncBarrier to work at all, even under trivial usage.

The following code never completes - the Console.WriteLine is never reached. Putting breakpoints on the return statements reveals that one of them is reached, but the other never is.

[Fact]
public async Task Test1()
{
    var barrier = new AsyncBarrier(2);

    var results = await Task.WhenAll(
        Task.Run(async () =>
        {
            await barrier.SignalAndWaitAsync();
            return 24;
        }),
        Task.Run(async () =>
        {
            await barrier.SignalAndWaitAsync();
            return 42;
        })
    );

    Console.WriteLine(string.Join(',', results));
}
@sakno sakno self-assigned this Aug 11, 2021
@sakno sakno added the bug Something isn't working label Aug 11, 2021
@sakno
Copy link
Collaborator

sakno commented Aug 11, 2021

@ascott18 , thanks for reporting bug. The commit with fix is already in develop branch. Could you please verify the fix? If everything fine I'll publish patched version on NuGet tomorrow.

@ascott18
Copy link
Author

Thanks for the quick turnaround. If the test you added is passing then I'd say its good and fixed.

@sakno sakno closed this as completed in a6cd5df Aug 12, 2021
@sakno
Copy link
Collaborator

sakno commented Aug 12, 2021

@ascott18 , release has been published on NuGet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants