Possible Duplicate:
Are reads and writes to properties atomic in C#?
Are the auto-generated setters atomic in .NET 4?
Public property Busy As boolean
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
They are not guaranteed to be.
Consider that the above compiles to a full form property with a backing field. A different thread may come in between the setter invocation and the actual assignment of the backing field.
Also, not all types can be assigned atomically – large value types (
DateTime,TimeSpanetc…) are too large for an atomic assignment.