pseudo-code:
class A
{
Dictionary<string, object> dic = new Dictionary<string, object>();
public Do()
{
some_a.SomeEvent += (s, e) =>
{
dic["some_string"] = new object();
};
dic["some_other_string"] = new object();
}
}
Is this safe? It would be if both dictionary operations were on single same thread. So are they?
EDIT In my situation event is fired in the same thread as Do
, so it's safe.