Do we need to block when we get a property in C #

In C #, is it necessary to block upon receipt of a non-volatile property? I know what we need to block when setting the property. how about receiving?

3.0 now provides an automatic property, is it a safe thread?

+3
source share
4 answers

No, automatic properties are not thread safe. It is nothing but syntactic sugar; the compiler automatically generates private support fields, just as if you manually wrote them out.

, , . , .

+4

. / , .

- , .

+4

. , .

+2

, . (, int ), .

, , .

getter/setter helped .

HTH

+1

All Articles