open System.Collections.Generic
open System.Runtime.Serialization.Formatters
open System.ComponentModel.DataAnnotations
open System.Globalization
let mutable keepGoingField = true
member this.DoWork () : unit =
let mutable keepGoing = true
while (Volatile.Read(&keepGoing)) do
if (i > 10) then raise (Exception("Too many"))
Console.WriteLine("Called");
Volatile.Write(&keepGoing, false)