Permalink
Browse files

Fix compilation errors in control.fs

  • Loading branch information...
1 parent b41ad1a commit a4d329e57773188727343e1f1eeceed640000add @ovatsus ovatsus committed Feb 18, 2013
Showing with 11 additions and 0 deletions.
  1. +11 −0 src/fsharp/FSharp.Core/control.fs
@@ -1502,6 +1502,16 @@ namespace Microsoft.FSharp.Control
// run actual await routine
// callback will be executed on the thread pool so we need to use TrampolineHolder.Protect to install trampoline
try
+#if FX_NO_TASK
+ ThreadPool.QueueUserWorkItem((fun _ ->
+ let asyncResult = WaitHandleIAsyncResult(waitHandle) :> System.IAsyncResult
+ if asyncResult.IsCompleted then
+ if latch.Enter() then
+ registration.Dispose()
+ aux.trampolineHolder.Protect(fun () -> scont true)
+ |> unfake
+ ), null) |> ignore
+#else
Task.Factory.FromAsync
(
WaitHandleIAsyncResult(waitHandle),
@@ -1512,6 +1522,7 @@ namespace Microsoft.FSharp.Control
|> unfake
)
|> ignore
+#endif
// if user has specified timeout different from Timeout.Infinite
// then start another async to track timeout expiration
// StartWithContinuations already installs trampoline so we can invoke continuation directly

0 comments on commit a4d329e

Please sign in to comment.