{"action":"created","comment":{"url":"https://api.github.com/repos/neovim/neovim/pulls/comments/34486830","id":34486830,"diff_hunk":"@@ -255,3 +202,50 @@ static void init_termios(struct termios *termios) FUNC_ATTR_NONNULL_ALL\n   termios->c_cc[VMIN]     = 1;\n   termios->c_cc[VTIME]    = 0;\n }\n+\n+static bool set_duplicating_descriptor(int fd, uv_pipe_t *pipe)\n+  FUNC_ATTR_NONNULL_ALL\n+{\n+  int fd_dup = dup(fd);\n+  if (fd_dup < 0) {\n+    ELOG(\"Failed to dup descriptor %d: %s\", fd, strerror(errno));\n+    return false;\n+  }\n+  int uv_result = uv_pipe_open(pipe, fd_dup);\n+  if (uv_result) {\n+    ELOG(\"Failed to set pipe to descriptor %d: %s\",\n+         fd_dup, uv_strerror(uv_result));\n+    close(fd_dup);\n+    return false;\n+  }\n+  return true;\n+}\n+\n+static void chld_handler(uv_signal_t *handle, int signum)","path":"src/nvim/event/pty_process.c","position":221,"original_position":221,"commit_id":"ba827b59a00e9b0497c618c9ed8eccd8a38eeca9","original_commit_id":"ba827b59a00e9b0497c618c9ed8eccd8a38eeca9","user":{"login":"oni-link","id":2077655,"avatar_url":"https://avatars.githubusercontent.com/u/2077655?v=3","gravatar_id":"","url":"https://api.github.com/users/oni-link","html_url":"https://github.com/oni-link","followers_url":"https://api.github.com/users/oni-link/followers","following_url":"https://api.github.com/users/oni-link/following{/other_user}","gists_url":"https://api.github.com/users/oni-link/gists{/gist_id}","starred_url":"https://api.github.com/users/oni-link/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oni-link/subscriptions","organizations_url":"https://api.github.com/users/oni-link/orgs","repos_url":"https://api.github.com/users/oni-link/repos","events_url":"https://api.github.com/users/oni-link/events{/privacy}","received_events_url":"https://api.github.com/users/oni-link/received_events","type":"User","site_admin":false},"body":"Are UvProcesses on a different loop than PtyProcesses? Otherwise an UvProcess could be handled here and in its exit callback (also two calls to `internal_exit_cb()`).","created_at":"2015-07-13T17:17:11Z","updated_at":"2015-07-13T17:17:11Z","html_url":"https://github.com/neovim/neovim/pull/2980#discussion_r34486830","pull_request_url":"https://api.github.com/repos/neovim/neovim/pulls/2980","_links":{"self":{"href":"https://api.github.com/repos/neovim/neovim/pulls/comments/34486830"},"html":{"href":"https://github.com/neovim/neovim/pull/2980#discussion_r34486830"},"pull_request":{"href":"https://api.github.com/repos/neovim/neovim/pulls/2980"}}},"pull_request":{"url":"https://api.github.com/repos/neovim/neovim/pulls/2980","id":39397877,"html_url":"https://github.com/neovim/neovim/pull/2980","diff_url":"https://github.com/neovim/neovim/pull/2980.diff","patch_url":"https://github.com/neovim/neovim/pull/2980.patch","issue_url":"https://api.github.com/repos/neovim/neovim/issues/2980","number":2980,"state":"open","locked":false,"title":"[WIP] Separate event loop layer","user":{"login":"tarruda","id":842846,"avatar_url":"https://avatars.githubusercontent.com/u/842846?v=3","gravatar_id":"","url":"https://api.github.com/users/tarruda","html_url":"https://github.com/tarruda","followers_url":"https://api.github.com/users/tarruda/followers","following_url":"https://api.github.com/users/tarruda/following{/other_user}","gists_url":"https://api.github.com/users/tarruda/gists{/gist_id}","starred_url":"https://api.github.com/users/tarruda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tarruda/subscriptions","organizations_url":"https://api.github.com/users/tarruda/orgs","repos_url":"https://api.github.com/users/tarruda/repos","events_url":"https://api.github.com/users/tarruda/events{/privacy}","received_events_url":"https://api.github.com/users/tarruda/received_events","type":"User","site_admin":false},"body":"Like #2650, this extracts some changes from my private #2371/fix branch. This PR separates the event loop layer from the rest of the code and builds a small abstraction around libuv/watcher API, which is done to keep some sanity for when the event loop runs in a separate thread. The goal is to contain multithreaded code under src/nvim/event and leave the rest as untouched as possible, with minimum amount of data/modules shared between threads.","created_at":"2015-07-07T17:53:22Z","updated_at":"2015-07-13T17:17:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cc7c483a42158f565034750eb465642c9ce9f86b","assignee":null,"milestone":{"url":"https://api.github.com/repos/neovim/neovim/milestones/5","html_url":"https://github.com/neovim/neovim/milestones/0.1-first-public-release","labels_url":"https://api.github.com/repos/neovim/neovim/milestones/5/labels","id":652241,"number":5,"title":"0.1-first-public-release","description":"","creator":{"login":"justinmk","id":1359421,"avatar_url":"https://avatars.githubusercontent.com/u/1359421?v=3","gravatar_id":"","url":"https://api.github.com/users/justinmk","html_url":"https://github.com/justinmk","followers_url":"https://api.github.com/users/justinmk/followers","following_url":"https://api.github.com/users/justinmk/following{/other_user}","gists_url":"https://api.github.com/users/justinmk/gists{/gist_id}","starred_url":"https://api.github.com/users/justinmk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinmk/subscriptions","organizations_url":"https://api.github.com/users/justinmk/orgs","repos_url":"https://api.github.com/users/justinmk/repos","events_url":"https://api.github.com/users/justinmk/events{/privacy}","received_events_url":"https://api.github.com/users/justinmk/received_events","type":"User","site_admin":false},"open_issues":20,"closed_issues":49,"state":"open","created_at":"2014-05-07T21:37:18Z","updated_at":"2015-07-12T03:17:18Z","due_on":"2015-09-01T04:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/neovim/neovim/pulls/2980/commits","review_comments_url":"https://api.github.com/repos/neovim/neovim/pulls/2980/comments","review_comment_url":"https://api.github.com/repos/neovim/neovim/pulls/comments{/number}","comments_url":"https://api.github.com/repos/neovim/neovim/issues/2980/comments","statuses_url":"https://api.github.com/repos/neovim/neovim/statuses/ba827b59a00e9b0497c618c9ed8eccd8a38eeca9","head":{"label":"tarruda:separate-event-loop-layer","ref":"separate-event-loop-layer","sha":"ba827b59a00e9b0497c618c9ed8eccd8a38eeca9","user":{"login":"tarruda","id":842846,"avatar_url":"https://avatars.githubusercontent.com/u/842846?v=3","gravatar_id":"","url":"https://api.github.com/users/tarruda","html_url":"https://github.com/tarruda","followers_url":"https://api.github.com/users/tarruda/followers","following_url":"https://api.github.com/users/tarruda/following{/other_user}","gists_url":"https://api.github.com/users/tarruda/gists{/gist_id}","starred_url":"https://api.github.com/users/tarruda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tarruda/subscriptions","organizations_url":"https://api.github.com/users/tarruda/orgs","repos_url":"https://api.github.com/users/tarruda/repos","events_url":"https://api.github.com/users/tarruda/events{/privacy}","received_events_url":"https://api.github.com/users/tarruda/received_events","type":"User","site_admin":false},"repo":{"id":17170945,"name":"neovim","full_name":"tarruda/neovim","owner":{"login":"tarruda","id":842846,"avatar_url":"https://avatars.githubusercontent.com/u/842846?v=3","gravatar_id":"","url":"https://api.github.com/users/tarruda","html_url":"https://github.com/tarruda","followers_url":"https://api.github.com/users/tarruda/followers","following_url":"https://api.github.com/users/tarruda/following{/other_user}","gists_url":"https://api.github.com/users/tarruda/gists{/gist_id}","starred_url":"https://api.github.com/users/tarruda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tarruda/subscriptions","organizations_url":"https://api.github.com/users/tarruda/orgs","repos_url":"https://api.github.com/users/tarruda/repos","events_url":"https://api.github.com/users/tarruda/events{/privacy}","received_events_url":"https://api.github.com/users/tarruda/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tarruda/neovim","description":"vim's rebirth for the 21st century","fork":true,"url":"https://api.github.com/repos/tarruda/neovim","forks_url":"https://api.github.com/repos/tarruda/neovim/forks","keys_url":"https://api.github.com/repos/tarruda/neovim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tarruda/neovim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tarruda/neovim/teams","hooks_url":"https://api.github.com/repos/tarruda/neovim/hooks","issue_events_url":"https://api.github.com/repos/tarruda/neovim/issues/events{/number}","events_url":"https://api.github.com/repos/tarruda/neovim/events","assignees_url":"https://api.github.com/repos/tarruda/neovim/assignees{/user}","branches_url":"https://api.github.com/repos/tarruda/neovim/branches{/branch}","tags_url":"https://api.github.com/repos/tarruda/neovim/tags","blobs_url":"https://api.github.com/repos/tarruda/neovim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tarruda/neovim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tarruda/neovim/git/refs{/sha}","trees_url":"https://api.github.com/repos/tarruda/neovim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tarruda/neovim/statuses/{sha}","languages_url":"https://api.github.com/repos/tarruda/neovim/languages","stargazers_url":"https://api.github.com/repos/tarruda/neovim/stargazers","contributors_url":"https://api.github.com/repos/tarruda/neovim/contributors","subscribers_url":"https://api.github.com/repos/tarruda/neovim/subscribers","subscription_url":"https://api.github.com/repos/tarruda/neovim/subscription","commits_url":"https://api.github.com/repos/tarruda/neovim/commits{/sha}","git_commits_url":"https://api.github.com/repos/tarruda/neovim/git/commits{/sha}","comments_url":"https://api.github.com/repos/tarruda/neovim/comments{/number}","issue_comment_url":"https://api.github.com/repos/tarruda/neovim/issues/comments{/number}","contents_url":"https://api.github.com/repos/tarruda/neovim/contents/{+path}","compare_url":"https://api.github.com/repos/tarruda/neovim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tarruda/neovim/merges","archive_url":"https://api.github.com/repos/tarruda/neovim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tarruda/neovim/downloads","issues_url":"https://api.github.com/repos/tarruda/neovim/issues{/number}","pulls_url":"https://api.github.com/repos/tarruda/neovim/pulls{/number}","milestones_url":"https://api.github.com/repos/tarruda/neovim/milestones{/number}","notifications_url":"https://api.github.com/repos/tarruda/neovim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tarruda/neovim/labels{/name}","releases_url":"https://api.github.com/repos/tarruda/neovim/releases{/id}","created_at":"2014-02-25T11:35:55Z","updated_at":"2014-12-23T20:52:21Z","pushed_at":"2015-07-13T14:30:39Z","git_url":"git://github.com/tarruda/neovim.git","ssh_url":"git@github.com:tarruda/neovim.git","clone_url":"https://github.com/tarruda/neovim.git","svn_url":"https://github.com/tarruda/neovim","homepage":"http://neovim.org/","size":42806,"stargazers_count":1,"watchers_count":1,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"neovim:master","ref":"master","sha":"c80ebfff82d539d44815b1d36709ba573e4e38e8","user":{"login":"neovim","id":6471485,"avatar_url":"https://avatars.githubusercontent.com/u/6471485?v=3","gravatar_id":"","url":"https://api.github.com/users/neovim","html_url":"https://github.com/neovim","followers_url":"https://api.github.com/users/neovim/followers","following_url":"https://api.github.com/users/neovim/following{/other_user}","gists_url":"https://api.github.com/users/neovim/gists{/gist_id}","starred_url":"https://api.github.com/users/neovim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neovim/subscriptions","organizations_url":"https://api.github.com/users/neovim/orgs","repos_url":"https://api.github.com/users/neovim/repos","events_url":"https://api.github.com/users/neovim/events{/privacy}","received_events_url":"https://api.github.com/users/neovim/received_events","type":"Organization","site_admin":false},"repo":{"id":16408992,"name":"neovim","full_name":"neovim/neovim","owner":{"login":"neovim","id":6471485,"avatar_url":"https://avatars.githubusercontent.com/u/6471485?v=3","gravatar_id":"","url":"https://api.github.com/users/neovim","html_url":"https://github.com/neovim","followers_url":"https://api.github.com/users/neovim/followers","following_url":"https://api.github.com/users/neovim/following{/other_user}","gists_url":"https://api.github.com/users/neovim/gists{/gist_id}","starred_url":"https://api.github.com/users/neovim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neovim/subscriptions","organizations_url":"https://api.github.com/users/neovim/orgs","repos_url":"https://api.github.com/users/neovim/repos","events_url":"https://api.github.com/users/neovim/events{/privacy}","received_events_url":"https://api.github.com/users/neovim/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/neovim/neovim","description":"ambitious Vim-fork focused on extensibility and agility. Consider helping sustain Neovim development! ","fork":false,"url":"https://api.github.com/repos/neovim/neovim","forks_url":"https://api.github.com/repos/neovim/neovim/forks","keys_url":"https://api.github.com/repos/neovim/neovim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/neovim/neovim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/neovim/neovim/teams","hooks_url":"https://api.github.com/repos/neovim/neovim/hooks","issue_events_url":"https://api.github.com/repos/neovim/neovim/issues/events{/number}","events_url":"https://api.github.com/repos/neovim/neovim/events","assignees_url":"https://api.github.com/repos/neovim/neovim/assignees{/user}","branches_url":"https://api.github.com/repos/neovim/neovim/branches{/branch}","tags_url":"https://api.github.com/repos/neovim/neovim/tags","blobs_url":"https://api.github.com/repos/neovim/neovim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/neovim/neovim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/neovim/neovim/git/refs{/sha}","trees_url":"https://api.github.com/repos/neovim/neovim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/neovim/neovim/statuses/{sha}","languages_url":"https://api.github.com/repos/neovim/neovim/languages","stargazers_url":"https://api.github.com/repos/neovim/neovim/stargazers","contributors_url":"https://api.github.com/repos/neovim/neovim/contributors","subscribers_url":"https://api.github.com/repos/neovim/neovim/subscribers","subscription_url":"https://api.github.com/repos/neovim/neovim/subscription","commits_url":"https://api.github.com/repos/neovim/neovim/commits{/sha}","git_commits_url":"https://api.github.com/repos/neovim/neovim/git/commits{/sha}","comments_url":"https://api.github.com/repos/neovim/neovim/comments{/number}","issue_comment_url":"https://api.github.com/repos/neovim/neovim/issues/comments{/number}","contents_url":"https://api.github.com/repos/neovim/neovim/contents/{+path}","compare_url":"https://api.github.com/repos/neovim/neovim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/neovim/neovim/merges","archive_url":"https://api.github.com/repos/neovim/neovim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/neovim/neovim/downloads","issues_url":"https://api.github.com/repos/neovim/neovim/issues{/number}","pulls_url":"https://api.github.com/repos/neovim/neovim/pulls{/number}","milestones_url":"https://api.github.com/repos/neovim/neovim/milestones{/number}","notifications_url":"https://api.github.com/repos/neovim/neovim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/neovim/neovim/labels{/name}","releases_url":"https://api.github.com/repos/neovim/neovim/releases{/id}","created_at":"2014-01-31T13:39:22Z","updated_at":"2015-07-13T15:44:25Z","pushed_at":"2015-07-13T14:30:39Z","git_url":"git://github.com/neovim/neovim.git","ssh_url":"git@github.com:neovim/neovim.git","clone_url":"https://github.com/neovim/neovim.git","svn_url":"https://github.com/neovim/neovim","homepage":"https://salt.bountysource.com/teams/neovim","size":74595,"stargazers_count":14117,"watchers_count":14117,"language":"VimL","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":968,"mirror_url":null,"open_issues_count":543,"forks":968,"open_issues":543,"watchers":14117,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/neovim/neovim/pulls/2980"},"html":{"href":"https://github.com/neovim/neovim/pull/2980"},"issue":{"href":"https://api.github.com/repos/neovim/neovim/issues/2980"},"comments":{"href":"https://api.github.com/repos/neovim/neovim/issues/2980/comments"},"review_comments":{"href":"https://api.github.com/repos/neovim/neovim/pulls/2980/comments"},"review_comment":{"href":"https://api.github.com/repos/neovim/neovim/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/neovim/neovim/pulls/2980/commits"},"statuses":{"href":"https://api.github.com/repos/neovim/neovim/statuses/ba827b59a00e9b0497c618c9ed8eccd8a38eeca9"}}}}