From 98eaa87df63f8efc141b743f313072f4c036c37b Mon Sep 17 00:00:00 2001 From: MattMo Date: Sun, 20 Mar 2022 12:44:30 -0700 Subject: [PATCH] Added code to see if the current thread is trying to abort and if so stops blocking. --- Rest.Net/Rest.Net/RouteListener.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rest.Net/Rest.Net/RouteListener.cs b/Rest.Net/Rest.Net/RouteListener.cs index b54a348..af818e2 100644 --- a/Rest.Net/Rest.Net/RouteListener.cs +++ b/Rest.Net/Rest.Net/RouteListener.cs @@ -197,7 +197,7 @@ namespace MontoyaTech.Rest.Net /// public void Block() { - while (this.HttpListener != null) + while (this.HttpListener != null && Thread.CurrentThread.ThreadState != ThreadState.AbortRequested && Thread.CurrentThread.ThreadState != ThreadState.Aborted) if (!Thread.Yield()) Thread.Sleep(1000); }