summary refs log tree commit diff
path: root/src/rt/rust_upcall.cpp
diff options
context:
space:
mode:
authorMichael Bebenita <mbebenita@mozilla.com>2010-07-28 12:36:59 -0700
committerGraydon Hoare <graydon@mozilla.com>2010-07-28 20:30:29 -0700
commit06b52b70db868285de5cf71166e5ce5b9dfb8e00 (patch)
tree001f3d749cc48a65a7f230399b6ca17a1392b766 /src/rt/rust_upcall.cpp
parentcc4906ba79e1ad05ef8a34e1cc9cfbe5f96d4c6c (diff)
downloadrust-06b52b70db868285de5cf71166e5ce5b9dfb8e00.tar.gz
rust-06b52b70db868285de5cf71166e5ce5b9dfb8e00.zip
Fix typos in comments, delete obsolete comments and dead commented code.
Diffstat (limited to 'src/rt/rust_upcall.cpp')
-rw-r--r--src/rt/rust_upcall.cpp65
1 files changed, 1 insertions, 64 deletions
diff --git a/src/rt/rust_upcall.cpp b/src/rt/rust_upcall.cpp
index 8ce40b576cf..77d39b859b3 100644
--- a/src/rt/rust_upcall.cpp
+++ b/src/rt/rust_upcall.cpp
@@ -74,7 +74,7 @@ extern "C" CDECL void upcall_del_port(rust_task *task, rust_port *port) {
 }
 
 /**
- * Creates a new channel, pointed to a specified port.
+ * Creates a new channel pointing to a given port.
  */
 extern "C" CDECL rust_chan*
 upcall_new_chan(rust_task *task, rust_port *port) {
@@ -115,69 +115,6 @@ upcall_clone_chan(rust_task *task,
     return new (spawnee->dom) rust_chan(spawnee, chan->port);
 }
 
-/*
- * Buffering protocol:
- *
- *   - Reader attempts to read:
- *     - Set reader to blocked-reading state.
- *     - If buf with data exists:
- *       - Attempt transmission.
- *
- *  - Writer attempts to write:
- *     - Set writer to blocked-writing state.
- *     - Copy data into chan.
- *     - Attempt transmission.
- *
- *  - Transmission:
- *       - Copy data from buf to reader
- *       - Decr buf
- *       - Set reader to running
- *       - If buf now empty and blocked writer:
- *         - Set blocked writer to running
- *
- */
-//
-//static int
-//attempt_transmission(rust_dom *dom, rust_chan *src, rust_task *dst) {
-//    I(dom, src);
-//    I(dom, dst);
-//
-//    rust_port *port = src->port;
-//    if (!port) {
-//        dom->log(rust_log::COMM, "src died, transmission incomplete");
-//        return 0;
-//    }
-//
-//    circular_buffer *buf = &src->buffer;
-//    if (buf->is_empty()) {
-//        dom->log(rust_log::COMM, "buffer empty, transmission incomplete");
-//        return 0;
-//    }
-//
-//    if (!dst->blocked_on(port)) {
-//        dom->log(rust_log::COMM,
-//                 "dst in non-reading state, transmission incomplete");
-//        return 0;
-//    }
-//
-//    uintptr_t *dptr = dst->dptr;
-//    dom->log(rust_log::COMM, "receiving %d bytes into dst_task=0x%" PRIxPTR
-//    ", dptr=0x%" PRIxPTR, port->unit_sz, dst, dptr);
-//    buf->dequeue(dptr);
-//
-//    // Wake up the sender if its waiting for the send operation.
-//    rust_task *sender = src->task;
-//    rust_token *token = &src->token;
-//    if (sender->blocked_on(token))
-//        sender->wakeup(token);
-//
-//    // Wake up the receiver, there is new data.
-//    dst->wakeup(port);
-//
-//    dom->log(rust_log::COMM, "transmission complete");
-//    return 1;
-//}
-
 extern "C" CDECL void upcall_yield(rust_task *task) {
     LOG_UPCALL_ENTRY(task);
     task->log(rust_log::UPCALL | rust_log::COMM, "upcall yield()");