{"action":"created","comment":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/comments/64451462","id":64451462,"diff_hunk":"@@ -126,6 +127,38 @@ fn wait<'a, 'b, T>(lock: &'a Mutex<State<T>>,\n     lock.lock().unwrap() // relock\n }\n \n+/// Same as wait, but waiting at most until `deadline`.\n+fn wait_timeout_receiver<'a, 'b, T>(lock: &'a Mutex<State<T>>,\n+                                    deadline: Instant,\n+                                    mut guard: MutexGuard<'b, State<T>>,\n+                                    woke_up: &mut bool)\n+                                    -> MutexGuard<'a, State<T>>\n+{\n+    let (wait_token, signal_token) = blocking::tokens();\n+    match mem::replace(&mut guard.blocker, BlockedReceiver(signal_token)) {\n+        NoneBlocked => {}\n+        _ => unreachable!(),\n+    }\n+    drop(guard);         // unlock\n+    *woke_up = wait_token.wait_max_until(deadline);   // block","path":"src/libstd/sync/mpsc/sync.rs","position":25,"original_position":25,"commit_id":"10450eff06fae08e8725661b049144f51e966fa1","original_commit_id":"10450eff06fae08e8725661b049144f51e966fa1","user":{"login":"alexcrichton","id":64996,"avatar_url":"https://avatars.githubusercontent.com/u/64996?v=3","gravatar_id":"","url":"https://api.github.com/users/alexcrichton","html_url":"https://github.com/alexcrichton","followers_url":"https://api.github.com/users/alexcrichton/followers","following_url":"https://api.github.com/users/alexcrichton/following{/other_user}","gists_url":"https://api.github.com/users/alexcrichton/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcrichton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcrichton/subscriptions","organizations_url":"https://api.github.com/users/alexcrichton/orgs","repos_url":"https://api.github.com/users/alexcrichton/repos","events_url":"https://api.github.com/users/alexcrichton/events{/privacy}","received_events_url":"https://api.github.com/users/alexcrichton/received_events","type":"User","site_admin":false},"body":"\"woke_up\" as a name here is somewhat of a misnomer b/c you can be woken up both for a timeout and for a message, perhaps \"success\"?","created_at":"2016-05-24T18:45:44Z","updated_at":"2016-05-24T18:45:44Z","html_url":"https://github.com/rust-lang/rust/pull/33748#discussion_r64451462","pull_request_url":"https://api.github.com/repos/rust-lang/rust/pulls/33748","_links":{"self":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/comments/64451462"},"html":{"href":"https://github.com/rust-lang/rust/pull/33748#discussion_r64451462"},"pull_request":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/33748"}}},"pull_request":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/33748","id":70787791,"html_url":"https://github.com/rust-lang/rust/pull/33748","diff_url":"https://github.com/rust-lang/rust/pull/33748.diff","patch_url":"https://github.com/rust-lang/rust/pull/33748.patch","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/33748","number":33748,"state":"open","locked":false,"title":"std: sync: Implement recv_timeout()","user":{"login":"emilio","id":1323194,"avatar_url":"https://avatars.githubusercontent.com/u/1323194?v=3","gravatar_id":"","url":"https://api.github.com/users/emilio","html_url":"https://github.com/emilio","followers_url":"https://api.github.com/users/emilio/followers","following_url":"https://api.github.com/users/emilio/following{/other_user}","gists_url":"https://api.github.com/users/emilio/gists{/gist_id}","starred_url":"https://api.github.com/users/emilio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emilio/subscriptions","organizations_url":"https://api.github.com/users/emilio/orgs","repos_url":"https://api.github.com/users/emilio/repos","events_url":"https://api.github.com/users/emilio/events{/privacy}","received_events_url":"https://api.github.com/users/emilio/received_events","type":"User","site_admin":false},"body":"This is an attempt to implement https://github.com/rust-lang/rfcs/issues/962.\r\n\r\nI'm not sure about if a change like this would require an rfc or something like\r\nthat, and this surely needs a lot more testing, but I wanted to take some eyes\r\non it before following.\r\n\r\ncc @metajack @asajeffrey https://github.com/servo/servo/pull/11279 https://github.com/servo/servo/pull/11283\r\n\r\nr? @aturon ","created_at":"2016-05-20T00:52:05Z","updated_at":"2016-05-24T18:45:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"af7e298f47487d9fa2caf51c77648e76c93a052d","assignee":{"login":"alexcrichton","id":64996,"avatar_url":"https://avatars.githubusercontent.com/u/64996?v=3","gravatar_id":"","url":"https://api.github.com/users/alexcrichton","html_url":"https://github.com/alexcrichton","followers_url":"https://api.github.com/users/alexcrichton/followers","following_url":"https://api.github.com/users/alexcrichton/following{/other_user}","gists_url":"https://api.github.com/users/alexcrichton/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcrichton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcrichton/subscriptions","organizations_url":"https://api.github.com/users/alexcrichton/orgs","repos_url":"https://api.github.com/users/alexcrichton/repos","events_url":"https://api.github.com/users/alexcrichton/events{/privacy}","received_events_url":"https://api.github.com/users/alexcrichton/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/rust-lang/rust/pulls/33748/commits","review_comments_url":"https://api.github.com/repos/rust-lang/rust/pulls/33748/comments","review_comment_url":"https://api.github.com/repos/rust-lang/rust/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/33748/comments","statuses_url":"https://api.github.com/repos/rust-lang/rust/statuses/10450eff06fae08e8725661b049144f51e966fa1","head":{"label":"emilio:mpsc-recv-timeout","ref":"mpsc-recv-timeout","sha":"10450eff06fae08e8725661b049144f51e966fa1","user":{"login":"emilio","id":1323194,"avatar_url":"https://avatars.githubusercontent.com/u/1323194?v=3","gravatar_id":"","url":"https://api.github.com/users/emilio","html_url":"https://github.com/emilio","followers_url":"https://api.github.com/users/emilio/followers","following_url":"https://api.github.com/users/emilio/following{/other_user}","gists_url":"https://api.github.com/users/emilio/gists{/gist_id}","starred_url":"https://api.github.com/users/emilio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emilio/subscriptions","organizations_url":"https://api.github.com/users/emilio/orgs","repos_url":"https://api.github.com/users/emilio/repos","events_url":"https://api.github.com/users/emilio/events{/privacy}","received_events_url":"https://api.github.com/users/emilio/received_events","type":"User","site_admin":false},"repo":{"id":49104343,"name":"rust","full_name":"emilio/rust","owner":{"login":"emilio","id":1323194,"avatar_url":"https://avatars.githubusercontent.com/u/1323194?v=3","gravatar_id":"","url":"https://api.github.com/users/emilio","html_url":"https://github.com/emilio","followers_url":"https://api.github.com/users/emilio/followers","following_url":"https://api.github.com/users/emilio/following{/other_user}","gists_url":"https://api.github.com/users/emilio/gists{/gist_id}","starred_url":"https://api.github.com/users/emilio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emilio/subscriptions","organizations_url":"https://api.github.com/users/emilio/orgs","repos_url":"https://api.github.com/users/emilio/repos","events_url":"https://api.github.com/users/emilio/events{/privacy}","received_events_url":"https://api.github.com/users/emilio/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/emilio/rust","description":"A safe, concurrent, practical language.","fork":true,"url":"https://api.github.com/repos/emilio/rust","forks_url":"https://api.github.com/repos/emilio/rust/forks","keys_url":"https://api.github.com/repos/emilio/rust/keys{/key_id}","collaborators_url":"https://api.github.com/repos/emilio/rust/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/emilio/rust/teams","hooks_url":"https://api.github.com/repos/emilio/rust/hooks","issue_events_url":"https://api.github.com/repos/emilio/rust/issues/events{/number}","events_url":"https://api.github.com/repos/emilio/rust/events","assignees_url":"https://api.github.com/repos/emilio/rust/assignees{/user}","branches_url":"https://api.github.com/repos/emilio/rust/branches{/branch}","tags_url":"https://api.github.com/repos/emilio/rust/tags","blobs_url":"https://api.github.com/repos/emilio/rust/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/emilio/rust/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/emilio/rust/git/refs{/sha}","trees_url":"https://api.github.com/repos/emilio/rust/git/trees{/sha}","statuses_url":"https://api.github.com/repos/emilio/rust/statuses/{sha}","languages_url":"https://api.github.com/repos/emilio/rust/languages","stargazers_url":"https://api.github.com/repos/emilio/rust/stargazers","contributors_url":"https://api.github.com/repos/emilio/rust/contributors","subscribers_url":"https://api.github.com/repos/emilio/rust/subscribers","subscription_url":"https://api.github.com/repos/emilio/rust/subscription","commits_url":"https://api.github.com/repos/emilio/rust/commits{/sha}","git_commits_url":"https://api.github.com/repos/emilio/rust/git/commits{/sha}","comments_url":"https://api.github.com/repos/emilio/rust/comments{/number}","issue_comment_url":"https://api.github.com/repos/emilio/rust/issues/comments{/number}","contents_url":"https://api.github.com/repos/emilio/rust/contents/{+path}","compare_url":"https://api.github.com/repos/emilio/rust/compare/{base}...{head}","merges_url":"https://api.github.com/repos/emilio/rust/merges","archive_url":"https://api.github.com/repos/emilio/rust/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/emilio/rust/downloads","issues_url":"https://api.github.com/repos/emilio/rust/issues{/number}","pulls_url":"https://api.github.com/repos/emilio/rust/pulls{/number}","milestones_url":"https://api.github.com/repos/emilio/rust/milestones{/number}","notifications_url":"https://api.github.com/repos/emilio/rust/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/emilio/rust/labels{/name}","releases_url":"https://api.github.com/repos/emilio/rust/releases{/id}","deployments_url":"https://api.github.com/repos/emilio/rust/deployments","created_at":"2016-01-06T01:42:00Z","updated_at":"2016-04-18T08:49:33Z","pushed_at":"2016-05-22T13:53:31Z","git_url":"git://github.com/emilio/rust.git","ssh_url":"git@github.com:emilio/rust.git","clone_url":"https://github.com/emilio/rust.git","svn_url":"https://github.com/emilio/rust","homepage":"http://www.rust-lang.org","size":295082,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rust-lang:master","ref":"master","sha":"764ef92ae7a26cbb9c2121de3812a0a17739f65f","user":{"login":"rust-lang","id":5430905,"avatar_url":"https://avatars.githubusercontent.com/u/5430905?v=3","gravatar_id":"","url":"https://api.github.com/users/rust-lang","html_url":"https://github.com/rust-lang","followers_url":"https://api.github.com/users/rust-lang/followers","following_url":"https://api.github.com/users/rust-lang/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang/subscriptions","organizations_url":"https://api.github.com/users/rust-lang/orgs","repos_url":"https://api.github.com/users/rust-lang/repos","events_url":"https://api.github.com/users/rust-lang/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":724712,"name":"rust","full_name":"rust-lang/rust","owner":{"login":"rust-lang","id":5430905,"avatar_url":"https://avatars.githubusercontent.com/u/5430905?v=3","gravatar_id":"","url":"https://api.github.com/users/rust-lang","html_url":"https://github.com/rust-lang","followers_url":"https://api.github.com/users/rust-lang/followers","following_url":"https://api.github.com/users/rust-lang/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang/subscriptions","organizations_url":"https://api.github.com/users/rust-lang/orgs","repos_url":"https://api.github.com/users/rust-lang/repos","events_url":"https://api.github.com/users/rust-lang/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rust-lang/rust","description":"A safe, concurrent, practical language.","fork":false,"url":"https://api.github.com/repos/rust-lang/rust","forks_url":"https://api.github.com/repos/rust-lang/rust/forks","keys_url":"https://api.github.com/repos/rust-lang/rust/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rust-lang/rust/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rust-lang/rust/teams","hooks_url":"https://api.github.com/repos/rust-lang/rust/hooks","issue_events_url":"https://api.github.com/repos/rust-lang/rust/issues/events{/number}","events_url":"https://api.github.com/repos/rust-lang/rust/events","assignees_url":"https://api.github.com/repos/rust-lang/rust/assignees{/user}","branches_url":"https://api.github.com/repos/rust-lang/rust/branches{/branch}","tags_url":"https://api.github.com/repos/rust-lang/rust/tags","blobs_url":"https://api.github.com/repos/rust-lang/rust/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rust-lang/rust/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rust-lang/rust/git/refs{/sha}","trees_url":"https://api.github.com/repos/rust-lang/rust/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rust-lang/rust/statuses/{sha}","languages_url":"https://api.github.com/repos/rust-lang/rust/languages","stargazers_url":"https://api.github.com/repos/rust-lang/rust/stargazers","contributors_url":"https://api.github.com/repos/rust-lang/rust/contributors","subscribers_url":"https://api.github.com/repos/rust-lang/rust/subscribers","subscription_url":"https://api.github.com/repos/rust-lang/rust/subscription","commits_url":"https://api.github.com/repos/rust-lang/rust/commits{/sha}","git_commits_url":"https://api.github.com/repos/rust-lang/rust/git/commits{/sha}","comments_url":"https://api.github.com/repos/rust-lang/rust/comments{/number}","issue_comment_url":"https://api.github.com/repos/rust-lang/rust/issues/comments{/number}","contents_url":"https://api.github.com/repos/rust-lang/rust/contents/{+path}","compare_url":"https://api.github.com/repos/rust-lang/rust/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rust-lang/rust/merges","archive_url":"https://api.github.com/repos/rust-lang/rust/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rust-lang/rust/downloads","issues_url":"https://api.github.com/repos/rust-lang/rust/issues{/number}","pulls_url":"https://api.github.com/repos/rust-lang/rust/pulls{/number}","milestones_url":"https://api.github.com/repos/rust-lang/rust/milestones{/number}","notifications_url":"https://api.github.com/repos/rust-lang/rust/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rust-lang/rust/labels{/name}","releases_url":"https://api.github.com/repos/rust-lang/rust/releases{/id}","deployments_url":"https://api.github.com/repos/rust-lang/rust/deployments","created_at":"2010-06-16T20:39:03Z","updated_at":"2016-05-24T18:34:33Z","pushed_at":"2016-05-24T18:35:12Z","git_url":"git://github.com/rust-lang/rust.git","ssh_url":"git@github.com:rust-lang/rust.git","clone_url":"https://github.com/rust-lang/rust.git","svn_url":"https://github.com/rust-lang/rust","homepage":"https://www.rust-lang.org","size":495593,"stargazers_count":16787,"watchers_count":16787,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3199,"mirror_url":null,"open_issues_count":2550,"forks":3199,"open_issues":2550,"watchers":16787,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/33748"},"html":{"href":"https://github.com/rust-lang/rust/pull/33748"},"issue":{"href":"https://api.github.com/repos/rust-lang/rust/issues/33748"},"comments":{"href":"https://api.github.com/repos/rust-lang/rust/issues/33748/comments"},"review_comments":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/33748/comments"},"review_comment":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rust-lang/rust/pulls/33748/commits"},"statuses":{"href":"https://api.github.com/repos/rust-lang/rust/statuses/10450eff06fae08e8725661b049144f51e966fa1"}}}}
{"actor":{"display_login":"alexcrichton"}}