Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion tests/monotouch-test/CoreFoundation/DispatchGroupTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
// Copyright 2013 Xamarin Inc. All rights reserved.
//

using System.Threading.Tasks;

using Xamarin.Utils;

namespace MonoTouchFixtures.CoreFoundation {
Expand All @@ -19,13 +21,15 @@ public void WaitTest ()
{
using (var dg = DispatchGroup.Create ()) {
var dq = DispatchQueue.GetGlobalQueue (DispatchQueuePriority.Default);
var called = new TaskCompletionSource<bool> ();

dg.DispatchAsync (dq, delegate
{
Console.WriteLine ("Inside dispatch");
called.SetResult (true);
});

Assert.That (dg.Wait (DispatchTime.Forever), Is.True);
Assert.That (called.Task.Result, Is.True, "Called");
Comment thread
rolfbjarne marked this conversation as resolved.
Resolved
dq.Dispose ();
}
}
Expand Down
Loading