Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit45c4026

Browse files
Vasily KirichenkoVasily Kirichenko
Vasily Kirichenko
authored and
Vasily Kirichenko
committed
revert cancellation token to repeatedlyProgressUntilDoneOrTimeShareOverOrCanceled
1 parente05d9ee commit45c4026

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

‎src/absil/illib.fs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ module ResultOrException =
494494
/// captured by the NotYetDone closure. Computations do not need to be restartable.
495495
///
496496
/// - The key thing is that you can take an Eventually value and run it with
497-
/// Eventually.repeatedlyProgressUntilDoneOrTimeShareOver
497+
/// Eventually.repeatedlyProgressUntilDoneOrTimeShareOverOrCanceled
498498
typeEventually<'T>=
499499
| Doneof'T
500500
| NotYetDoneof(unit->Eventually<'T>)
@@ -521,7 +521,7 @@ module Eventually =
521521

522522
/// Keep running the computation bit by bit until a time limit is reached.
523523
/// The runner gets called each time the computation is restarted
524-
letrepeatedlyProgressUntilDoneOrTimeShareOver timeShareInMilliseconds runner e=
524+
letrepeatedlyProgressUntilDoneOrTimeShareOverOrCanceled timeShareInMilliseconds(ct:CancellationToken)runner e=
525525
letsw=new System.Diagnostics.Stopwatch()
526526
let recrunTimeShare e=
527527
runner(fun()->
@@ -531,7 +531,7 @@ module Eventually =
531531
match ewith
532532
| Done_-> e
533533
| NotYetDone work->
534-
if sw.ElapsedMilliseconds> timeShareInMillisecondsthen
534+
ifct.IsCancellationRequested||sw.ElapsedMilliseconds> timeShareInMillisecondsthen
535535
sw.Stop();
536536
NotYetDone(fun()-> runTimeShare e)
537537
else

‎src/fsharp/vs/IncrementalBuild.fs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1497,8 +1497,9 @@ type IncrementalBuilder(frameworkTcImportsCache: FrameworkImportsCache, tcConfig
14971497
if ensureReactivethen
14981498
lettimeSlicedComputation=
14991499
fullComputation|>
1500-
Eventually.repeatedlyProgressUntilDoneOrTimeShareOver
1500+
Eventually.repeatedlyProgressUntilDoneOrTimeShareOverOrCanceled
15011501
maxTimeShareMilliseconds
1502+
CancellationToken.None
15021503
(fun f->
15031504
// Reinstall the compilation globals each time we start or restart
15041505
use unwind=new CompilationGlobalsScope(errorLogger, BuildPhase.TypeCheck, projectDirectory)

‎src/fsharp/vs/service.fs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1722,6 +1722,7 @@ module internal Parser =
17221722

17231723
// Typecheck the real input.
17241724
letsink= TcResultsSinkImpl(tcGlobals, source= source)
1725+
let!ct= Async.CancellationToken
17251726

17261727
let!tcEnvAtEndOpt=
17271728
async{
@@ -1735,7 +1736,7 @@ module internal Parser =
17351736

17361737
let!result=
17371738
TypeCheckOneInputAndFinishEventually(checkForErrors,tcConfig, tcImports, tcGlobals, None, TcResultsSink.WithSink sink, tcState, parsedMainInput)
1738-
|> Eventually.repeatedlyProgressUntilDoneOrTimeShareOver50L(fun f-> f())
1739+
|> Eventually.repeatedlyProgressUntilDoneOrTimeShareOverOrCanceled50L ct(fun f-> f())
17391740
|> Eventually.forceAsync
17401741
(fun(work: unit-> Eventually<_>)->
17411742
reactorOps.EnqueueAndAwaitOpAsync("TypeCheckOneFile",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp