启动后线程IsAlive = false

按照作业中的详细说明,我遇到线程IsAlive = true / false的问题。 我的thread.Start()似乎启动了它,IsAlive = true,但是在循环中当我想暂停该错误时说:IsAlive = false(CollectImagesCount(fileCounter))获得三个属性)。 任何的想法?

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace Pics
{
    class Program
    {

        static void Main(string[] args)
        {
            FileCounterModel fileCounter = new FileCounterModel();
            //fileCounter.SourcePath = "C:\\pics";
            //fileCounter.DestinationPath = "C:\\pics2";
            //fileCounter.FileCount = 5;

            Thread thread = new Thread(() => CollectImagesCount(fileCounter));
            thread.Priority = ThreadPriority.AboveNormal;
            thread.Start();

            string response;

            do
            {
                Console.WriteLine("Interakciók: s -suspend, r - resume, a - abort, q - qiut");
                response = Console.ReadLine();

                if (response.ToLower() == "s")
                {
                    thread.Suspend();
                    Console.Write($"\nA szál él-e (true/false): {thread.IsAlive}");
                    Console.Write($"Az eddig megtalált képek száma: {fileCounter.FileCount}");
                }

                if (response.ToLower() == "r")
                {
                    thread.Resume();
                    Console.Write($"\nA szál él-e (true/false): {thread.IsAlive}");
                    Console.Write($"Az eddig megtalált képek száma: {fileCounter.FileCount}");
                }
                if (response.ToLower() == "a")
                {
                    thread.Abort();
                    Console.Write($"\nA szál él-e (true/false): {thread.IsAlive}");
                    Console.Write($"Az eddig megtalált képek száma: {fileCounter.FileCount}");
                }
            } while (!thread.IsAlive || response != "q");

            thread.Join();


            Console.ReadLine();
        }

        private static void CollectImagesCount(object model)
        {
            var fileCounter = model as FileCounterModel;
            fileCounter.SourcePath = "C:\\pics";
            fileCounter.DestinationPath = "C:\\pics2";

            if (fileCounter == null)
            {
                throw new ArgumentException("nem lehet FileCounterModel -é convertálni");
            }

            Stack<string> mapsAndFiles = new Stack<string>();
            mapsAndFiles.Push(fileCounter.SourcePath);

            var stat = new FileCounterModel();

            while (mapsAndFiles.Count > 0)
            {
                var actualPath = mapsAndFiles.Pop(); //amit fel kell dolgozni

                var directories = Directory.GetDirectories(actualPath);
                string[] supportedFiles = new string[] { ".png", ".PNG", ".jpg", ".JPG", ".jpeg", ".JPEG", ".bmp", ".BMP", ".gif", ".GIF" };

                if (directories.Length > 0)
                {
                    foreach (var directory in directories)
                    {
                        mapsAndFiles.Push(directory); //még ennek a mappának a tartalmát is fel akarjuk dolgozni
                    }
                }

                var files = Directory.GetFiles(actualPath);

                if (directories.Length > 0)
                {
                    foreach (var supp in supportedFiles)
                    {
                        //files.Where(x => x.Contains(supp));
                        //fileCounter.FileCount++;
                        if (files.Where(x => x.Contains(supp)) != null)
                        {
                            fileCounter.FileCount++;
                        }
                    }
                 }
            }
        }
    }
}


任何帮助表示赞赏!