Skip to content

Commit ae7bf60

Browse files
fix OcDispatcherTests.DisposeTest
1 parent e88cc48 commit ae7bf60

File tree

1 file changed

+5
-25
lines changed

1 file changed

+5
-25
lines changed

src/ObservableComputations.Test/OcDispatcherTests.cs

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -442,43 +442,28 @@ public void DisposeTest()
442442
ManualResetEventSlim mre = new ManualResetEventSlim(false);
443443
bool invoked1 = false;
444444
bool invoked2 = false;
445-
bool freezed = false;
446445
InvocationResult<bool> invocationResult1 = null;
447446
InvocationResult<bool> invocationResult2 = null;
448447

449448
dispatcher.InvokeAsync(() =>
450449
{
451450
dispatcher.InvokeAsync(() =>
452451
{
453-
freezed = true;
454452
mre.Wait();
455453
});
456454

457-
458-
invocationResult1 = dispatcher.Invoke(() =>
459-
{
460-
mre.Wait();
461-
invoked1 = true;
462-
return true;
463-
});
455+
mre.Wait();
456+
invocationResult1 = dispatcher.Invoke(() => invoked1 = true);
464457

465458
});
466459

467460
Thread thread = new Thread(
468461
() =>
469462
{
470-
while (!freezed)
471-
{
472-
473-
}
474-
475-
invocationResult2 = dispatcher.Invoke(() =>
476-
{
477-
mre.Wait();
478-
invoked2 = true;
479-
return true;
480-
});
463+
mre.Wait();
464+
invocationResult2 = dispatcher.Invoke(() => invoked2 = true);
481465
});
466+
482467
thread.Start();
483468

484469
ManualResetEventSlim mreDisposed = new ManualResetEventSlim(false);
@@ -489,11 +474,6 @@ public void DisposeTest()
489474
mreDisposed.Set();
490475
};
491476

492-
while (dispatcher.GetQueueCount() != 2)
493-
{
494-
495-
}
496-
497477
dispatcher.Dispose();
498478
mre.Set();
499479
thread.Join();

0 commit comments

Comments
 (0)