C
Claes R
Hi !
I would like this class method to be thread safe.
public static ArrayList List(DateTime date)
{
ArrayList l = new ArrayList();
l.Add(new ListItemInfo( 1, "S1010"));
......
return l;
}
How do i accomplish this in a scalable way ?
lock works on a object, not class (or ??)
Would his suffice ??
public static ArrayList List(DateTime date)
{
Monitor.Enter()
ArrayList l = new ArrayList();
l.Add(new ListItemInfo( 1, "S1010"));
......
return l;
Monitor.Exit()
}
Alternatives ??
Thanks
Claes
I would like this class method to be thread safe.
public static ArrayList List(DateTime date)
{
ArrayList l = new ArrayList();
l.Add(new ListItemInfo( 1, "S1010"));
......
return l;
}
How do i accomplish this in a scalable way ?
lock works on a object, not class (or ??)
Would his suffice ??
public static ArrayList List(DateTime date)
{
Monitor.Enter()
ArrayList l = new ArrayList();
l.Add(new ListItemInfo( 1, "S1010"));
......
return l;
Monitor.Exit()
}
Alternatives ??
Thanks
Claes