about summary refs log tree commit diff
path: root/src/rt/rust_chan.cpp
diff options
context:
space:
mode:
authorEric Holk <eholk@mozilla.com>2011-07-27 16:45:11 -0700
committerEric Holk <eholk@mozilla.com>2011-07-28 10:47:29 -0700
commit9618ab67ae8fc6e82bb16e29ea52125acf183fc8 (patch)
tree2c7dc74914629d9b43cc7460ea0a5f73351bc43f /src/rt/rust_chan.cpp
parentb85dee8d5b223869c1b8c3917ed41b5373a29bb1 (diff)
downloadrust-9618ab67ae8fc6e82bb16e29ea52125acf183fc8.tar.gz
rust-9618ab67ae8fc6e82bb16e29ea52125acf183fc8.zip
Re-enabled the rest of the asserts and things in rust_chan.cpp
Diffstat (limited to 'src/rt/rust_chan.cpp')
-rw-r--r--src/rt/rust_chan.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/rt/rust_chan.cpp b/src/rt/rust_chan.cpp
index c32e6b6cc5b..d77b196fd35 100644
--- a/src/rt/rust_chan.cpp
+++ b/src/rt/rust_chan.cpp
@@ -22,8 +22,8 @@ rust_chan::~rust_chan() {
     KLOG(kernel, 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, is_associated() == false,
+      "Channel must be disassociated before being freed.");
 }
 
 /**
@@ -51,8 +51,8 @@ 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, is_associated(),
+      "Channel must be associated with a port.");
 
     if (port->is_proxy() == false) {
         scoped_lock with(port->referent()->lock);
@@ -73,8 +73,7 @@ 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());
+    I(kernel, !port->is_proxy());
 
     rust_port *target_port = port->referent();
     // TODO: We can probably avoid this lock by using atomic operations in
@@ -84,13 +83,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(kernel, is_associated(),
+          "rust_chan::transmit with no associated port.");
         return;
     }
 
-    // A(sched, !buffer.is_empty(),
-    //   "rust_chan::transmit with nothing to send.");
+    A(kernel, !buffer.is_empty(),
+      "rust_chan::transmit with nothing to send.");
 
     if (port->is_proxy()) {
         data_message::send(buffer.peek(), buffer.unit_sz, "send data",
@@ -121,8 +120,8 @@ rust_chan *rust_chan::clone(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, ref_count == 0,
+      "Channel's ref count should be zero.");
 
     if (is_associated()) {
         if (port->is_proxy()) {