Is there a problem in race condition in the code below?
Private Shared Sub TestRandomNumberGeneration(ByVal random As Random)
Dim failed As Boolean = False
Parallel.For(0, 100000, Sub(i, state)
Dim [next] As Integer = random.Next()
If [next] = 0 Then
Volatile.Write(failed, True)
state.Stop()
End If
End Sub)
Assert.IsFalse(failed)
End Sub