protected virtual void Dispose(bool disposing)
 {
     if (!isDisposed)
     {
         isDisposed = true;
         thread?.Exit();
     }
 }