Public MustInherit Class SingletonBase(Of T As {New, SingletonBase(Of T)})
    Private Shared m_instance As T = Nothing
    Private Shared ReadOnly lockObj As Object = New Object()
    Public Shared ReadOnly Property instance As T
        Get
            If (m_instance Is Nothing) Then
                SyncLock lockObj
                    If (m_instance Is Nothing) Then
                        m_instance = New T
                    End If
                End SyncLock
            End If
            Return m_instance
        End Get
    End Property
End Class
