forked from dotnet/fsharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't try to access if thread is not running - fixes dotnet#3171
- Loading branch information
Showing
1 changed file
with
8 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,8 +103,14 @@ module internal RoslynHelpers = | |
async { do! Async.SwitchToThreadPool() | ||
return! computation }, | ||
continuation=(fun result -> disposeReg(); tcs.TrySetResult(result) |> ignore), | ||
exceptionContinuation=(function :? OperationCanceledException -> disposeReg(); tcs.TrySetCanceled(cancellationToken) |> ignore | ||
| exn -> disposeReg(); tcs.TrySetException(exn) |> ignore), | ||
exceptionContinuation=(function :? OperationCanceledException -> | ||
disposeReg() | ||
if tcs.Task.Status = TaskStatus.Running then | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
forki
Author
Owner
|
||
tcs.TrySetCanceled(cancellationToken) |> ignore | ||
| exn -> | ||
disposeReg() | ||
if tcs.Task.Status = TaskStatus.Running then | ||
This comment has been minimized.
Sorry, something went wrong. |
||
tcs.TrySetException(exn) |> ignore), | ||
cancellationContinuation=(fun _oce -> disposeReg(); tcs.TrySetCanceled(cancellationToken) |> ignore), | ||
cancellationToken=cancellationToken) | ||
task | ||
|
could there be a race condition between this line and the next?