N
N
neomichi2016-02-23 13:58:41
C++ / C#
neomichi, 2016-02-23 13:58:41

Do I need to create a CancellationToken for each task?

Do I need to create a new CancellationToken for each task ? or you can use one:

public static CancellationToken DefaultTimeToken = new CancellationTokenSource(TimeSpan.FromMilliseconds(3000)).Token;

and use in all tasks

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
MonkAlex, 2016-02-23
@MonkAlex

Eee and cancel absolutely all tasks with one token? If it suits you, you can.

M
Melz, 2016-02-24
@melz

Can. In the same place an example on the first page with this task.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question