If I register some callbacks to a CancellationToken before it is cancelled, it seems they will be invoked in reverse order when the token is cancelled. Is this invocation order guaranteed?
var cts = new CancellationTokenSource();
var token = cts.Token;
token.Register(() => Console.WriteLine("1"));
token.Register(() => Console.WriteLine("2"));
token.Register(() => Console.WriteLine("3"));
cts.Cancel();
This will output
3
2
1