GitHub PullRequestReviewCommentEvent at 2014-01-21 18:19:09
Repository: rust
Actor: bill-myers
Payload: {"comment":{"url":"https://api.github.com/repos/mozilla/rust/pulls/comments/9047451","id":9047451,"diff_hunk":"@@ -0,0 +1,407 @@\n+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT\n+// file at the top-level directory of this distribution and at\n+// http://rust-lang.org/COPYRIGHT.\n+//\n+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or\n+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license\n+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your\n+// option. This file may not be copied, modified, or distributed\n+// except according to those terms.\n+\n+/// Shared channels\n+///\n+/// This is the flavor of channels which are not necessarily optimized for any\n+/// particular use case, but are the most general in how they are used. Shared\n+/// channels are cloneable allowing for multiple senders.\n+///\n+/// High level implementation details can be found in the comment of the parent\n+/// module. You'll also note that the implementation of the shared and stream\n+/// channels are quite similar, and this is no coincidence!\n+\n+use int;\n+use iter::Iterator;\n+use kinds::Send;\n+use ops::Drop;\n+use option::{Some, None};\n+use result::{Ok, Err, Result};\n+use rt::local::Local;\n+use rt::task::{Task, BlockedTask};\n+use rt::thread::Thread;\n+use sync::atomics;\n+use vec::OwnedVector;\n+\n+use mpsc = sync::mpsc_queue;\n+\n+static DISCONNECTED: int = int::min_value;\n+static FUDGE: int = 1024;","path":"src/libstd/comm/shared.rs","position":36,"original_position":36,"commit_id":"8e94f9b27f8518c1ff62724f983f1d7119951821","original_commit_id":"8e94f9b27f8518c1ff62724f983f1d7119951821","user":{"login":"bill-myers","id":4647491,"avatar_url":"https://gravatar.com/avatar/f4ed1ee6024527195be32106eec346e2?d=https%3A%2F%2Fidenticons.github.com%2Fe013b4407ccff880f9202d21513158c7.png&r=x","gravatar_id":"f4ed1ee6024527195be32106eec346e2","url":"https://api.github.com/users/bill-myers","html_url":"https://github.com/bill-myers","followers_url":"https://api.github.com/users/bill-myers/followers","following_url":"https://api.github.com/users/bill-myers/following{/other_user}","gists_url":"https://api.github.com/users/bill-myers/gists{/gist_id}","starred_url":"https://api.github.com/users/bill-myers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bill-myers/subscriptions","organizations_url":"https://api.github.com/users/bill-myers/orgs","repos_url":"https://api.github.com/users/bill-myers/repos","events_url":"https://api.github.com/users/bill-myers/events{/privacy}","received_events_url":"https://api.github.com/users/bill-myers/received_events","type":"User","site_admin":false},"body":"Why this magic number? It seems this is wrong.\r\n\r\nDoes this mean that this code will break when more than 1024 tasks happen to be in the race window?\r\n\r\nWhy not just check for < -2 or < DISCONNECTED / 2 instead of < DISCONNECTED + FUDGE?\r\n","created_at":"2014-01-21T18:19:09Z","updated_at":"2014-01-21T18:19:09Z","html_url":"https://github.com/mozilla/rust/pull/11578#discussion_r9047451","pull_request_url":"https://api.github.com/repos/mozilla/rust/pulls/11578","_links":{"self":{"href":"https://api.github.com/repos/mozilla/rust/pulls/comments/9047451"},"html":{"href":"https://github.com/mozilla/rust/pull/11578#discussion_r9047451"},"pull_request":{"href":"https://api.github.com/repos/mozilla/rust/pulls/11578"}}}}