@@ -41,9 +41,7 @@ public class RedisPubSubServer : IRedisPubSubServer
4141 private int noOfContinuousErrors = 0 ;
4242 private string lastExMsg = null ;
4343 private int status ;
44- #if ! NETSTANDARD1_3
4544 private Thread bgThread ; //Subscription controller thread
46- #endif
4745 private long bgThreadCount = 0 ;
4846
4947 private const int NO = 0 ;
@@ -111,9 +109,6 @@ public IRedisPubSubServer Start()
111109 if ( OnStart != null )
112110 OnStart ( ) ;
113111
114- #if NETSTANDARD1_3
115- RunLoop ( ) ;
116- #else
117112 //Don't kill us if we're the thread that's retrying to Start() after a failure.
118113 if ( bgThread != Thread . CurrentThread )
119114 {
@@ -134,7 +129,6 @@ public IRedisPubSubServer Start()
134129 Log . Debug ( "Retrying RunLoop() on Thread: " + bgThread . Name ) ;
135130 RunLoop ( ) ;
136131 }
137- #endif
138132 }
139133 catch ( Exception ex )
140134 {
@@ -438,14 +432,14 @@ public void Restart()
438432 Stop ( shouldRestart : true ) ;
439433 }
440434
441- #if ! NETSTANDARD1_3
442435 private void KillBgThreadIfExists ( )
443436 {
444437 if ( bgThread != null && bgThread . IsAlive )
445438 {
446439 //give it a small chance to die gracefully
447440 if ( ! bgThread . Join ( 500 ) )
448441 {
442+ #if ! NETSTANDARD1_3
449443 //Ideally we shouldn't get here, but lets try our hardest to clean it up
450444 Log . Warn ( "Interrupting previous Background Thread: " + bgThread . Name ) ;
451445 bgThread . Interrupt ( ) ;
@@ -454,11 +448,11 @@ private void KillBgThreadIfExists()
454448 Log . Warn ( bgThread . Name + " just wont die, so we're now aborting it..." ) ;
455449 bgThread . Abort ( ) ;
456450 }
451+ #endif
457452 }
458453 bgThread = null ;
459454 }
460455 }
461- #endif
462456
463457 private void SleepBackOffMultiplier ( int continuousErrorsCount )
464458 {
@@ -567,7 +561,6 @@ public virtual void Dispose()
567561 Log . Error ( "Error OnDispose(): " , ex ) ;
568562 }
569563
570- #if ! NETSTANDARD1_3
571564 try
572565 {
573566 Thread . Sleep ( 100 ) ; //give it a small chance to die gracefully
@@ -577,7 +570,6 @@ public virtual void Dispose()
577570 {
578571 if ( this . OnError != null ) this . OnError ( ex ) ;
579572 }
580- #endif
581573
582574 DisposeHeartbeatTimer ( ) ;
583575 }
0 commit comments