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 -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -