{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/coreclr/issues/2113","labels_url":"https://api.github.com/repos/dotnet/coreclr/issues/2113/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/coreclr/issues/2113/comments","events_url":"https://api.github.com/repos/dotnet/coreclr/issues/2113/events","html_url":"https://github.com/dotnet/coreclr/issues/2113","id":117935271,"number":2113,"title":"Resetable CancellationTokenSource registrations","user":{"login":"benaadams","id":1142958,"avatar_url":"https://avatars.githubusercontent.com/u/1142958?v=3","gravatar_id":"","url":"https://api.github.com/users/benaadams","html_url":"https://github.com/benaadams","followers_url":"https://api.github.com/users/benaadams/followers","following_url":"https://api.github.com/users/benaadams/following{/other_user}","gists_url":"https://api.github.com/users/benaadams/gists{/gist_id}","starred_url":"https://api.github.com/users/benaadams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benaadams/subscriptions","organizations_url":"https://api.github.com/users/benaadams/orgs","repos_url":"https://api.github.com/users/benaadams/repos","events_url":"https://api.github.com/users/benaadams/events{/privacy}","received_events_url":"https://api.github.com/users/benaadams/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":25,"created_at":"2015-11-19T23:49:35Z","updated_at":"2015-11-21T14:23:37Z","closed_at":null,"body":"`CancellationTokenSource` is quite a heavyweight object and its not normally cancelled; however it can't be pooled or reused because its registrations cannot be cleared.\r\n\r\nIts composed of the following objects:\r\n```csharp\r\nManualResetEvent m_kernelEvent\r\nSparselyPopulatedArray<CancellationCallbackInfo>[] m_registeredCallbacksLists\r\nint m_state\r\nint m_threadIDExecutingCallbacks\r\nbool m_disposed\r\nCancellationTokenRegistration [] m_linkingRegistrations\r\nCancellationCallbackInfo m_executingCallback\r\nTimer m_timer\r\n```\r\n\r\nA `ClearRegistrations()` or `Reset()` function would be very helpful."},"comment":{"url":"https://api.github.com/repos/dotnet/coreclr/issues/comments/158646912","html_url":"https://github.com/dotnet/coreclr/issues/2113#issuecomment-158646912","issue_url":"https://api.github.com/repos/dotnet/coreclr/issues/2113","id":158646912,"user":{"login":"benaadams","id":1142958,"avatar_url":"https://avatars.githubusercontent.com/u/1142958?v=3","gravatar_id":"","url":"https://api.github.com/users/benaadams","html_url":"https://github.com/benaadams","followers_url":"https://api.github.com/users/benaadams/followers","following_url":"https://api.github.com/users/benaadams/following{/other_user}","gists_url":"https://api.github.com/users/benaadams/gists{/gist_id}","starred_url":"https://api.github.com/users/benaadams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benaadams/subscriptions","organizations_url":"https://api.github.com/users/benaadams/orgs","repos_url":"https://api.github.com/users/benaadams/repos","events_url":"https://api.github.com/users/benaadams/events{/privacy}","received_events_url":"https://api.github.com/users/benaadams/received_events","type":"User","site_admin":false},"created_at":"2015-11-21T14:23:37Z","updated_at":"2015-11-21T14:23:37Z","body":"Heh, that's a really good idea! Can't see the wood for the trees...\r\n\r\nMerged it into the current PR, thank you!\r\n\r\n@stephentoub Should this issue be closed?"}}