2

I'm having this exception in my C# application....

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)

In DeleteRow () ... I am deleting a row from grid after some sleep time.... here is the code below :

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);
    }
}
msrd0
  • 7,816
  • 9
  • 47
  • 82

1 Answers1

0

Fixed.. The ThreadPool was generating it, I was keep pushing the same DEAD thread to ThreadPool thats why this error was occuring. Thanks guys.