AdjustThreadInPool,线程中止异常

本文关键字:异常 线程 AdjustThreadInPool | 更新日期: 2023-09-27 18:25:19

我的C#应用程序中出现了此异常。。。。

System.Threading.ThreadAbortException: Thread was being aborted.
   at System.Threading.ThreadPool.AdjustThreadsInPool(UInt32 QueueLength)
   at System.Threading.ThreadPool.QueueUserWorkItemHelper(WaitCallback
callBack, Object state, StackCrawlMark& stackMark, Boolean compressStack)
   at System.Threading.ThreadPool.QueueUserWorkItem(WaitCallback callBack, Object state)
   at burhanClient.RowDeleterThreadManager.Push(String
message)
   at burhanClient.DeleteRow(Object OrdId)

DeleteRow ()中。。。经过一段睡眠时间后,我将从网格中删除一行。。。。这是下面的代码:

public void DeleteRow(object OrdId)
{
    try
    {
        string OrderID = OrdId.ToString();
        Thread.Sleep(GlobalSettings.GetSettings().OrderDisappearTime);
        string query = ColumnOrderID.Name + " ='" + OrdId + "'";
        LiveOrdersDS.OrdersRow[] rows = CustomSelect(query);
        if (rows.Length > 0)
        {
            string status = converter.convertOrdStatus(rows[0].ColumnStatus.ToString());
            if (OrdStatus.FILLED == status || OrdStatus.CLOSED == status || OrdStatus.CANCLED == status)
            {
                // Start Temp Code
                logger.Info("Order: (" + OrderID + ") Deleting Row From Blotter");
                // End Temp Code
                RowDelThdManager.Push(OrderID);
            }
        }
    }
    catch (Exception ex)
    {
        SendMail(ex);
    }
}

AdjustThreadInPool,线程中止异常

已修复。。ThreadPool正在生成它,我一直在向ThreadPool推送相同的DEAD线程,这就是为什么会发生这个错误。谢谢大家。