mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2025-12-14 18:15:44 +00:00
Throw if CancellationToken passed to CancellableThrough is not already cancelled
This commit is contained in:
parent
3b1a1438bb
commit
3c6cb1fb43
1 changed files with 1 additions and 0 deletions
|
|
@ -85,6 +85,7 @@ public class FFMpegArgumentProcessor
|
||||||
|
|
||||||
public FFMpegArgumentProcessor CancellableThrough(CancellationToken token, int timeout = 0)
|
public FFMpegArgumentProcessor CancellableThrough(CancellationToken token, int timeout = 0)
|
||||||
{
|
{
|
||||||
|
token.ThrowIfCancellationRequested();
|
||||||
_cancellationTokenRegistration?.Dispose();
|
_cancellationTokenRegistration?.Dispose();
|
||||||
_cancellationTokenRegistration = token.Register(() => Cancel(timeout));
|
_cancellationTokenRegistration = token.Register(() => Cancel(timeout));
|
||||||
return this;
|
return this;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue