static void Main()
{
var foo = new Foo();
foo.instanceA = new Bar();
foo.instanceB = new Bar();
//Assuming every method on Bar is thread safe is it safe to access the foo object to call a method on Bar from any thread?
foo.instanceA.DoSomething();
}
public class Foo
{
public Bar instanceA;
public Bar instanceB;
}
public class Bar
{
public void DoSomething()
{
}
}
static void Main()
{
var foo = new Foo();
foo.instanceA = new Bar();
foo.instanceB = new Bar();
//Assuming every method on Bar is thread safe is it safe to access the foo object to call a method on Bar from any thread?
foo.instanceA.DoSomething();
}
public class Foo
{
public Bar instanceA;
public Bar instanceB;
}
public class Bar
{
public void DoSomething()
{
}
}