我在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);
}
}
答案 0 :(得分:0)
修正.. ThreadPool正在生成它,我一直在向ThreadPool推送相同的DEAD线程,这就是为什么会发生这个错误。 谢谢你们。