@@ -43,17 +43,6 @@ type Reactor() =
4343
4444 let mutable bgOpCts = new CancellationTokenSource()
4545
46- let threadsUsed = System.Collections.Concurrent.ConcurrentDictionary< int, byte>()
47-
48- let useThread ( thread : Thread ) =
49- thread.CurrentUICulture <- culture
50- threadsUsed.[ thread.ManagedThreadId] <- 0 uy
51- { new IDisposable with
52- member _.Dispose () =
53- let res , _ = threadsUsed.TryRemove( thread.ManagedThreadId)
54- assert res
55- }
56-
5746 /// Mailbox dispatch function.
5847 let builder =
5948 MailboxProcessor<_>. Start <| fun inbox ->
@@ -80,9 +69,7 @@ type Reactor() =
8069 Trace.TraceInformation( " Reactor: {0:n3} pausing {1} milliseconds" , DateTime.Now.TimeOfDay.TotalSeconds, pauseBeforeBackgroundWork)
8170 pauseBeforeBackgroundWork
8271 return ! inbox.TryReceive( timeout) }
83-
84- use _disposable = useThread Thread.CurrentThread
85-
72+ Thread.CurrentThread.CurrentUICulture <- culture
8673 match msg with
8774 | Some ( SetBackgroundOp bgOpOpt) ->
8875 //Trace.TraceInformation("Reactor: --> set background op, remaining {0}", inbox.CurrentQueueLength)
@@ -211,18 +198,6 @@ type Reactor() =
211198 return ! resultCell.AsyncResult
212199 }
213200
214- member r.ExecuteOrEnqueueAndAwaitOpAsync ( userOpName , opName , opArg , f ) =
215- if threadsUsed.ContainsKey( Thread.CurrentThread.ManagedThreadId) then
216- async {
217- let! ct = Async.CancellationToken
218- let result =
219- match Cancellable.run ct ( f ( AssumeCompilationThreadWithoutEvidence())) with
220- | ValueOrCancelled.Value r -> r
221- | ValueOrCancelled.Cancelled e -> raise e
222- return result }
223- else
224- r.EnqueueAndAwaitOpAsync( userOpName, opName, opArg, f)
225-
226201 member __.PauseBeforeBackgroundWork with get() = pauseBeforeBackgroundWork and set v = pauseBeforeBackgroundWork <- v
227202
228203 static member Singleton = theReactor
0 commit comments