vb.net - Using SyncLock inside a property -


i have variable being used multiple threads, using synclock when getting , setting variable. wondering if can wrap synclock inside property, don't have type synclock statements every time use variable:

private _obj new object public property obj() object             synclock _obj             return _obj         end synclock      end     set(value object)         synclock _obj             _obj = value         end synclock      end set end property 

i unsure block, since end synclock statement after return statement. couldn't find online, wondering if i'm going wrong. thanks.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Socket.connect doesn't throw exception in Android -

iphone - How do I keep MDScrollView from truncating my row headers and making my cells look bad? -