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
Post a Comment