- How do I use Thread.VolatileWrite with reference types with Option Strict On?
- Option Strict On
- Imports System.Threading
- Module Module1
- Dim str As String
- Sub Main()
- Thread.VolatileWrite(str, "HELLO") ' Compiler error.
- Thread.VolatileWrite(CObj(str), "HELLO") ' Fails silently.
- Thread.VolatileWrite(DirectCast(str), "HELLO") ' Fails silently.
- Console.WriteLine(str)
- End Sub
- End Module