Re: can an instance method be thread safe



Mike,

Not completely. Since you are accessing this.Name, that needs to be
thread safe. If access to this.Name is thread safe, then in this case, yes,
this is thread safe.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx

"miked" <miked@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:685FE0B1-A0ED-432A-965C-29500E916AF9@xxxxxxxxxxxxxxxx
If an instance method does not alter the containing class or any arguments
of
a referenced type is it thread safe?

public void GetSomething() {
return new Something(this.Name);
}
public string Name;

Thanks,

Mike


.