{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/PTVS/pulls/comments/32779562","id":32779562,"diff_hunk":"@@ -589,5 +598,74 @@ IServiceProvider serviceProvider\n             info._lock.Release();\r\n             return res;\r\n         }\r\n+\r\n+        private sealed class InterpretersEnumerator : IEnumerator<IPythonInterpreterFactory> {\r\n+            private readonly InterpreterOptionsService _owner;\r\n+            private readonly IEnumerator<IPythonInterpreterFactory> _e;\r\n+\r\n+            public InterpretersEnumerator(InterpreterOptionsService owner, IEnumerator<IPythonInterpreterFactory> e) {\r\n+                _owner = owner;\r\n+                _owner.BeginSuppressInterpretersChangedEvent();\r\n+                _e = e;\r\n+            }\r\n+\r\n+            public void Dispose() {\r\n+                Dispose(true);\r\n+                GC.SuppressFinalize(this);\r\n+            }\r\n+\r\n+            private void Dispose(bool disposing) {\r\n+                if (disposing) {\r\n+                    _e.Dispose();\r\n+                }\r\n+                _owner.EndSuppressInterpretersChangedEvent();\r\n+            }\r\n+\r\n+            ~InterpretersEnumerator() {\r\n+                Debug.Fail(\"Interpreter enumerator should always be disposed\");\r\n+                Dispose(false);\r\n+            }\r\n+\r\n+            public IPythonInterpreterFactory Current { get { return _e.Current; } }\r","path":"Python/Product/VSInterpreters/InterpreterOptionsService.cs","position":120,"original_position":120,"commit_id":"16a989659bed45c7b0b1ba3f554c4ba687a43f3a","original_commit_id":"16a989659bed45c7b0b1ba3f554c4ba687a43f3a","user":{"login":"zooba","id":1693688,"avatar_url":"https://avatars.githubusercontent.com/u/1693688?v=3","gravatar_id":"","url":"https://api.github.com/users/zooba","html_url":"https://github.com/zooba","followers_url":"https://api.github.com/users/zooba/followers","following_url":"https://api.github.com/users/zooba/following{/other_user}","gists_url":"https://api.github.com/users/zooba/gists{/gist_id}","starred_url":"https://api.github.com/users/zooba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zooba/subscriptions","organizations_url":"https://api.github.com/users/zooba/orgs","repos_url":"https://api.github.com/users/zooba/repos","events_url":"https://api.github.com/users/zooba/events{/privacy}","received_events_url":"https://api.github.com/users/zooba/received_events","type":"User","site_admin":false},"body":"What's wrong with the formatting?","created_at":"2015-06-18T21:17:36Z","updated_at":"2015-06-18T21:17:36Z","html_url":"https://github.com/Microsoft/PTVS/pull/477#discussion_r32779562","pull_request_url":"https://api.github.com/repos/Microsoft/PTVS/pulls/477","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/PTVS/pulls/comments/32779562"},"html":{"href":"https://github.com/Microsoft/PTVS/pull/477#discussion_r32779562"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/PTVS/pulls/477"}}},"pull_request":{"url":"https://api.github.com/repos/Microsoft/PTVS/pulls/477","id":38048467,"html_url":"https://github.com/Microsoft/PTVS/pull/477","diff_url":"https://github.com/Microsoft/PTVS/pull/477.diff","patch_url":"https://github.com/Microsoft/PTVS/pull/477.patch","issue_url":"https://api.github.com/repos/Microsoft/PTVS/issues/477","number":477,"state":"open","locked":false,"title":"Fixes #300 Race condition refreshing environments","user":{"login":"zooba","id":1693688,"avatar_url":"https://avatars.githubusercontent.com/u/1693688?v=3","gravatar_id":"","url":"https://api.github.com/users/zooba","html_url":"https://github.com/zooba","followers_url":"https://api.github.com/users/zooba/followers","following_url":"https://api.github.com/users/zooba/following{/other_user}","gists_url":"https://api.github.com/users/zooba/gists{/gist_id}","starred_url":"https://api.github.com/users/zooba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zooba/subscriptions","organizations_url":"https://api.github.com/users/zooba/orgs","repos_url":"https://api.github.com/users/zooba/repos","events_url":"https://api.github.com/users/zooba/events{/privacy}","received_events_url":"https://api.github.com/users/zooba/received_events","type":"User","site_admin":false},"body":"Fixes #300 Race condition refreshing environments\r\nAdds enumerable implementation for getting the list of interpreters from the service. This enumerable will suppress change events during enumeration and try harder to get a coherent list of factories from the providers.\r\nAdds a race-condition test to flush out threading issues.\r\nHardens mock classes to avoid causing false positives in the race-condition test. The actual VS classes are either thread-safe or marshal back to the UI thread, but there's no value in forcing that here.","created_at":"2015-06-18T20:21:09Z","updated_at":"2015-06-18T21:17:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"caf84c20732704dc69c2571dca27fa9b6d87ceb0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/PTVS/pulls/477/commits","review_comments_url":"https://api.github.com/repos/Microsoft/PTVS/pulls/477/comments","review_comment_url":"https://api.github.com/repos/Microsoft/PTVS/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/PTVS/issues/477/comments","statuses_url":"https://api.github.com/repos/Microsoft/PTVS/statuses/16a989659bed45c7b0b1ba3f554c4ba687a43f3a","head":{"label":"zooba:issue-300","ref":"issue-300","sha":"16a989659bed45c7b0b1ba3f554c4ba687a43f3a","user":{"login":"zooba","id":1693688,"avatar_url":"https://avatars.githubusercontent.com/u/1693688?v=3","gravatar_id":"","url":"https://api.github.com/users/zooba","html_url":"https://github.com/zooba","followers_url":"https://api.github.com/users/zooba/followers","following_url":"https://api.github.com/users/zooba/following{/other_user}","gists_url":"https://api.github.com/users/zooba/gists{/gist_id}","starred_url":"https://api.github.com/users/zooba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zooba/subscriptions","organizations_url":"https://api.github.com/users/zooba/orgs","repos_url":"https://api.github.com/users/zooba/repos","events_url":"https://api.github.com/users/zooba/events{/privacy}","received_events_url":"https://api.github.com/users/zooba/received_events","type":"User","site_admin":false},"repo":{"id":34676763,"name":"PTVS","full_name":"zooba/PTVS","owner":{"login":"zooba","id":1693688,"avatar_url":"https://avatars.githubusercontent.com/u/1693688?v=3","gravatar_id":"","url":"https://api.github.com/users/zooba","html_url":"https://github.com/zooba","followers_url":"https://api.github.com/users/zooba/followers","following_url":"https://api.github.com/users/zooba/following{/other_user}","gists_url":"https://api.github.com/users/zooba/gists{/gist_id}","starred_url":"https://api.github.com/users/zooba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zooba/subscriptions","organizations_url":"https://api.github.com/users/zooba/orgs","repos_url":"https://api.github.com/users/zooba/repos","events_url":"https://api.github.com/users/zooba/events{/privacy}","received_events_url":"https://api.github.com/users/zooba/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zooba/PTVS","description":"Python Tools for Visual Studio","fork":true,"url":"https://api.github.com/repos/zooba/PTVS","forks_url":"https://api.github.com/repos/zooba/PTVS/forks","keys_url":"https://api.github.com/repos/zooba/PTVS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zooba/PTVS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zooba/PTVS/teams","hooks_url":"https://api.github.com/repos/zooba/PTVS/hooks","issue_events_url":"https://api.github.com/repos/zooba/PTVS/issues/events{/number}","events_url":"https://api.github.com/repos/zooba/PTVS/events","assignees_url":"https://api.github.com/repos/zooba/PTVS/assignees{/user}","branches_url":"https://api.github.com/repos/zooba/PTVS/branches{/branch}","tags_url":"https://api.github.com/repos/zooba/PTVS/tags","blobs_url":"https://api.github.com/repos/zooba/PTVS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zooba/PTVS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zooba/PTVS/git/refs{/sha}","trees_url":"https://api.github.com/repos/zooba/PTVS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zooba/PTVS/statuses/{sha}","languages_url":"https://api.github.com/repos/zooba/PTVS/languages","stargazers_url":"https://api.github.com/repos/zooba/PTVS/stargazers","contributors_url":"https://api.github.com/repos/zooba/PTVS/contributors","subscribers_url":"https://api.github.com/repos/zooba/PTVS/subscribers","subscription_url":"https://api.github.com/repos/zooba/PTVS/subscription","commits_url":"https://api.github.com/repos/zooba/PTVS/commits{/sha}","git_commits_url":"https://api.github.com/repos/zooba/PTVS/git/commits{/sha}","comments_url":"https://api.github.com/repos/zooba/PTVS/comments{/number}","issue_comment_url":"https://api.github.com/repos/zooba/PTVS/issues/comments{/number}","contents_url":"https://api.github.com/repos/zooba/PTVS/contents/{+path}","compare_url":"https://api.github.com/repos/zooba/PTVS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zooba/PTVS/merges","archive_url":"https://api.github.com/repos/zooba/PTVS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zooba/PTVS/downloads","issues_url":"https://api.github.com/repos/zooba/PTVS/issues{/number}","pulls_url":"https://api.github.com/repos/zooba/PTVS/pulls{/number}","milestones_url":"https://api.github.com/repos/zooba/PTVS/milestones{/number}","notifications_url":"https://api.github.com/repos/zooba/PTVS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zooba/PTVS/labels{/name}","releases_url":"https://api.github.com/repos/zooba/PTVS/releases{/id}","created_at":"2015-04-27T16:05:59Z","updated_at":"2015-05-05T16:35:34Z","pushed_at":"2015-06-18T20:22:51Z","git_url":"git://github.com/zooba/PTVS.git","ssh_url":"git@github.com:zooba/PTVS.git","clone_url":"https://github.com/zooba/PTVS.git","svn_url":"https://github.com/zooba/PTVS","homepage":"https://microsoft.github.io/PTVS","size":137120,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Microsoft:master","ref":"master","sha":"0598a241f11a2be126f8d0c5c2e7f916f76dab9b","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":32487763,"name":"PTVS","full_name":"Microsoft/PTVS","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/PTVS","description":"Python Tools for Visual Studio","fork":false,"url":"https://api.github.com/repos/Microsoft/PTVS","forks_url":"https://api.github.com/repos/Microsoft/PTVS/forks","keys_url":"https://api.github.com/repos/Microsoft/PTVS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/PTVS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/PTVS/teams","hooks_url":"https://api.github.com/repos/Microsoft/PTVS/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/PTVS/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/PTVS/events","assignees_url":"https://api.github.com/repos/Microsoft/PTVS/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/PTVS/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/PTVS/tags","blobs_url":"https://api.github.com/repos/Microsoft/PTVS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/PTVS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/PTVS/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/PTVS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/PTVS/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/PTVS/languages","stargazers_url":"https://api.github.com/repos/Microsoft/PTVS/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/PTVS/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/PTVS/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/PTVS/subscription","commits_url":"https://api.github.com/repos/Microsoft/PTVS/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/PTVS/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/PTVS/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/PTVS/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/PTVS/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/PTVS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/PTVS/merges","archive_url":"https://api.github.com/repos/Microsoft/PTVS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/PTVS/downloads","issues_url":"https://api.github.com/repos/Microsoft/PTVS/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/PTVS/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/PTVS/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/PTVS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/PTVS/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/PTVS/releases{/id}","created_at":"2015-03-18T22:30:53Z","updated_at":"2015-06-18T12:57:52Z","pushed_at":"2015-06-18T20:22:05Z","git_url":"git://github.com/Microsoft/PTVS.git","ssh_url":"git@github.com:Microsoft/PTVS.git","clone_url":"https://github.com/Microsoft/PTVS.git","svn_url":"https://github.com/Microsoft/PTVS","homepage":"https://microsoft.github.io/PTVS","size":147736,"stargazers_count":299,"watchers_count":299,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":49,"mirror_url":null,"open_issues_count":190,"forks":49,"open_issues":190,"watchers":299,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/PTVS/pulls/477"},"html":{"href":"https://github.com/Microsoft/PTVS/pull/477"},"issue":{"href":"https://api.github.com/repos/Microsoft/PTVS/issues/477"},"comments":{"href":"https://api.github.com/repos/Microsoft/PTVS/issues/477/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/PTVS/pulls/477/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/PTVS/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/PTVS/pulls/477/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/PTVS/statuses/16a989659bed45c7b0b1ba3f554c4ba687a43f3a"}}}}