File tree Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -6,28 +6,23 @@ open System.Threading
66[<Sealed>]
77type Cancellable =
88 [<ThreadStatic; DefaultValue>]
9- static val mutable private token : CancellationToken option
9+ static val mutable private token : CancellationToken
1010
1111 static member UsingToken ( ct ) =
1212 let oldCt = Cancellable.token
1313
14- Cancellable.token <- Some ct
14+ Cancellable.token <- ct
1515
1616 { new IDisposable with
1717 member this.Dispose () = Cancellable.token <- oldCt
1818 }
1919
2020 static member Token
21- with get () =
22- match Cancellable.token with
23- | None -> CancellationToken.None
24- | Some ct -> ct
25- and internal set v = Cancellable.token <- Some v
21+ with get () = Cancellable.token
22+ and internal set v = Cancellable.token <- v
2623
2724 static member CheckAndThrow () =
28- match Cancellable.token with
29- | Some token -> token.ThrowIfCancellationRequested()
30- | _ -> ()
25+ Cancellable.token.ThrowIfCancellationRequested()
3126
3227namespace Internal.Utilities.Library
3328
You can’t perform that action at this time.
0 commit comments