Monday, January 26, 2015

Populate and clear list in a task

Hi Kevin,


I tried to use a "lock" in the method FillCollection :



public static void FillCollection(DynamicCollection<T> dc)
{
var obj_lock = new object();
lock (obj_lock)
{
dc.Clear();
// Populate the list in a loop ...
}
}

Not sure it is the good way because I still have the same issues. What do you think ?

No comments:

Post a Comment