Skip to content

Commit

Permalink
Add System.Threading.Tasks Never() implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
desplesda committed May 21, 2024
1 parent e1e352c commit 91f7aca
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions Runtime/AsyncHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,14 @@ internal static async YarnTask Wait(this System.Threading.Tasks.Task task, TimeS
}
#endif

internal static YarnTask Never(CancellationToken cancellationToken) {
#if USE_UNITASK
return UniTask.Never(cancellationToken);
#else
return Task.Delay(Timeout.Infinite, cancellationToken);
#endif
}

}

}
2 changes: 1 addition & 1 deletion Runtime/LineProviders/BuiltinLocalisedLineProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public string AssetLocaleCode
set => _assetLocaleCode = value;
}

private YarnTask prepareForLinesTask = YarnTask.Never(CancellationToken.None);
private YarnTask prepareForLinesTask = YarnAsync.Never(CancellationToken.None);

public override bool LinesAvailable => prepareForLinesTask.IsCompletedSuccessfully();

Expand Down

0 comments on commit 91f7aca

Please sign in to comment.