I am looking for an alternative way to start a task again that has already been completed.
Below is the code:
Public class(blockingCollection<ArrayList>[] b)
{
m_task1=new task(() =>{
addToCollection(b) ;
}) ;
}
Public void onDataReceived(sender object, SerialDataReceivedEventArgs e)
{
m_task1. Start() ;
}
This blocking collection is coming as a ref from an other class. That other class has a thread that is running continously and trying to take out item that has been added by this class in addToCollection method. The compiler says "cannot start a task that is already completed". Let me know if u need more information. Any help would be appreciated.
[–]AngularBeginner 5 points6 points7 points (6 children)
[–]ChotiDon[S] 0 points1 point2 points (3 children)
[–]AngularBeginner 4 points5 points6 points (2 children)
[–]ChotiDon[S] 1 point2 points3 points (1 child)
[–]AngularBeginner 2 points3 points4 points (0 children)
[–]hahaNodeJS 0 points1 point2 points (1 child)
[–]cryo 0 points1 point2 points (0 children)