简单的属性是否需要同步?

时间:2016-10-04 11:32:00

标签: c# .net vb.net multithreading synchronization

我有一个简单的属性:

Private _t As DateTime = DateTime.Now
    Public Property Test As DateTime
        Get
            Return _t
        End Get
        Set(value As DateTime)
            _t = value
        End Set
    End Property

现在我有两个独立的线程:线程1永久调用getter,线程2永久调用setter with datetime.now

我是否需要同步该属性? 该属性是处于未定义状态还是空/无状态还是会一直返回日期?

0 个答案:

没有答案