We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3347544 commit 6a5ae88Copy full SHA for 6a5ae88
test/Microsoft.VisualStudio.Threading.Tests/JoinableTaskCollectionTests.cs
@@ -196,4 +196,21 @@ public void JoinDisposedTwice()
196
return Task.CompletedTask;
197
});
198
}
199
+
200
+ [Fact]
201
+ public void JoinTillEmptyWorksWithRefCounting()
202
+ {
203
+ var finishTaskEvent = new AsyncManualResetEvent();
204
+ JoinableTask? task = this.JoinableFactory.RunAsync(async delegate { await finishTaskEvent.WaitAsync().ConfigureAwait(false); });
205
206
+ var collection = new JoinableTaskCollection(this.context, refCountAddedJobs: true);
207
208
+ collection.Add(task);
209
210
211
+ finishTaskEvent.Set();
212
213
+ Task? waiter = collection!.JoinTillEmptyAsync();
214
+ Assert.True(waiter.Wait(UnexpectedTimeout));
215
+ }
216
0 commit comments