Does thread safety remarks on methods cover properties as well?

I'm pretty new to writing C#, but I've come to understand that Properties are just syntactic sugar for writing getters and setters. So when the documentation states

Any public static members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

would it be correct to assume that this applies to properties as well? I.e. any static property would be guaranteed to be thread safe but not instance properties.

Answers


A member includes properties, fields and methods. So yes, a static member of the type if declared as such is threadsafe. As a property is a member, the static properties are threadsafe.

@Sehe has caught me on Events are also "members". Not sure what a threadsafe event would do though ;)


Need Your Help

Modify sub key in *plist files

shell scripting osx plist

I'm would like to modify a subkey in a plist file (i.e. "TB Item Identifiers"):

Django self-referential relationship?

python django django-models

I'm trying to create model Page, page should be able to have "child pages" too.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.