Skip to content

Commit 388491a

Browse files
committed
made ThreadStatics public (allowing evacuation in WinForms/WPF "thread-stealing" scenarios)
1 parent 83c9a1c commit 388491a

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/FSharp.Data.Adaptive/Core/AdaptiveObject.fs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ module AdadptiveObjectExtensions =
9797
[<DefaultValue; ThreadStatic>]
9898
static val mutable private _Callbacks : list<unit -> unit>
9999

100+
static member Callbacks
101+
with get() = AfterEvaluateCallbacks._Callbacks
102+
and set v = AfterEvaluateCallbacks._Callbacks <- v
103+
100104
static member Add(action : unit -> unit) =
101105
if AdaptiveObject.UnsafeEvaluationDepth <= 0 then transact action
102106
elif isNull (AfterEvaluateCallbacks._Callbacks :> obj) then AfterEvaluateCallbacks._Callbacks <- [action]

src/FSharp.Data.Adaptive/Core/Transaction.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ type Transaction() =
7272
/// Gets or sets the transaction currently running on this thread (if any)
7373
static member Running
7474
with get() = Transaction.RunningTransaction
75-
and internal set r = Transaction.RunningTransaction <- r
75+
and set r = Transaction.RunningTransaction <- r
7676

7777
/// Gets or sets the transaction currently being built on this thread (via transact (fun () -> ...))
7878
static member Current
7979
with get() = Transaction.CurrentTransaction
80-
and internal set r = Transaction.CurrentTransaction <- r
80+
and set r = Transaction.CurrentTransaction <- r
8181

8282
/// Indicates if inside a running Transaction
8383
static member HasRunning =

0 commit comments

Comments
 (0)