diff options
Diffstat (limited to 'src/rt/rust_chan.cpp')
| -rw-r--r-- | src/rt/rust_chan.cpp | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/src/rt/rust_chan.cpp b/src/rt/rust_chan.cpp index 470be6e6a37..9253d7d0361 100644 --- a/src/rt/rust_chan.cpp +++ b/src/rt/rust_chan.cpp @@ -13,17 +13,17 @@ rust_chan::rust_chan(rust_kernel *kernel, maybe_proxy<rust_port> *port, if (port) { associate(port); } - DLOG(kernel->sched, comm, "new rust_chan(task=0x%" PRIxPTR - ", port=0x%" PRIxPTR ") -> chan=0x%" PRIxPTR, - (uintptr_t) task, (uintptr_t) port, (uintptr_t) this); + // DLOG(task->sched, comm, "new rust_chan(task=0x%" PRIxPTR + // ", port=0x%" PRIxPTR ") -> chan=0x%" PRIxPTR, + // (uintptr_t) task, (uintptr_t) port, (uintptr_t) this); } rust_chan::~rust_chan() { - DLOG(kernel->sched, comm, "del rust_chan(task=0x%" PRIxPTR ")", - (uintptr_t) this); + // DLOG(kernel->sched, comm, "del rust_chan(task=0x%" PRIxPTR ")", + // (uintptr_t) this); - A(kernel->sched, is_associated() == false, - "Channel must be disassociated before being freed."); + // A(kernel->sched, is_associated() == false, + // "Channel must be disassociated before being freed."); } /** @@ -33,9 +33,9 @@ void rust_chan::associate(maybe_proxy<rust_port> *port) { this->port = port; if (port->is_proxy() == false) { scoped_lock with(port->referent()->lock); - DLOG(kernel->sched, task, - "associating chan: 0x%" PRIxPTR " with port: 0x%" PRIxPTR, - this, port); + // DLOG(kernel->sched, task, + // "associating chan: 0x%" PRIxPTR " with port: 0x%" PRIxPTR, + // this, port); ++this->ref_count; this->task = port->referent()->task; this->task->ref(); @@ -51,14 +51,14 @@ bool rust_chan::is_associated() { * Unlink this channel from its associated port. */ void rust_chan::disassociate() { - A(kernel->sched, is_associated(), - "Channel must be associated with a port."); + // A(kernel->sched, is_associated(), + // "Channel must be associated with a port."); if (port->is_proxy() == false) { scoped_lock with(port->referent()->lock); - DLOG(kernel->sched, task, - "disassociating chan: 0x%" PRIxPTR " from port: 0x%" PRIxPTR, - this, port->referent()); + // DLOG(kernel->sched, task, + // "disassociating chan: 0x%" PRIxPTR " from port: 0x%" PRIxPTR, + // this, port->referent()); --this->ref_count; --this->task->ref_count; this->task = NULL; @@ -73,8 +73,8 @@ void rust_chan::disassociate() { * Attempt to send data to the associated port. */ void rust_chan::send(void *sptr) { - rust_scheduler *sched = kernel->sched; - I(sched, !port->is_proxy()); + // rust_scheduler *sched = kernel->sched; + // I(sched, !port->is_proxy()); rust_port *target_port = port->referent(); // TODO: We can probably avoid this lock by using atomic operations in @@ -84,13 +84,13 @@ void rust_chan::send(void *sptr) { buffer.enqueue(sptr); if (!is_associated()) { - W(sched, is_associated(), - "rust_chan::transmit with no associated port."); + // W(sched, is_associated(), + // "rust_chan::transmit with no associated port."); return; } - A(sched, !buffer.is_empty(), - "rust_chan::transmit with nothing to send."); + // A(sched, !buffer.is_empty(), + // "rust_chan::transmit with nothing to send."); if (port->is_proxy()) { data_message::send(buffer.peek(), buffer.unit_sz, "send data", @@ -98,7 +98,7 @@ void rust_chan::send(void *sptr) { buffer.dequeue(NULL); } else { if (target_port->task->blocked_on(target_port)) { - DLOG(sched, comm, "dequeued in rendezvous_ptr"); + // DLOG(sched, comm, "dequeued in rendezvous_ptr"); buffer.dequeue(target_port->task->rendezvous_ptr); target_port->task->rendezvous_ptr = 0; target_port->task->wakeup(target_port); @@ -120,7 +120,7 @@ rust_chan *rust_chan::clone(maybe_proxy<rust_task> *target) { rust_handle<rust_port> *handle = task->sched->kernel->get_port_handle(port->as_referent()); maybe_proxy<rust_port> *proxy = new rust_proxy<rust_port> (handle); - DLOG(kernel->sched, mem, "new proxy: " PTR, proxy); + DLOG(task->sched, mem, "new proxy: " PTR, proxy); port = proxy; target_task = target->as_proxy()->handle()->referent(); } @@ -133,8 +133,8 @@ rust_chan *rust_chan::clone(maybe_proxy<rust_task> *target) { * appear to be live, causing modify-after-free errors. */ void rust_chan::destroy() { - A(kernel->sched, ref_count == 0, - "Channel's ref count should be zero."); + // A(kernel->sched, ref_count == 0, + // "Channel's ref count should be zero."); if (is_associated()) { if (port->is_proxy()) { |
