diff options
| author | Jeff Olson <olson.jeffery@gmail.com> | 2012-04-11 22:14:45 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-04-20 15:23:21 -0700 |
| commit | f06362d5bbef9c569e06d66662cf49ead846ce0a (patch) | |
| tree | b8515927dc6ad7b4eac6e5aaacb11dae299a1acc | |
| parent | c6667c06c34a25a8a21a1805b4f454f2d05d337c (diff) | |
| download | rust-f06362d5bbef9c569e06d66662cf49ead846ce0a.tar.gz rust-f06362d5bbef9c569e06d66662cf49ead846ce0a.zip | |
exporting priv::weaken_task and adding some debug logging
| -rw-r--r-- | src/libcore/priv.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libcore/priv.rs b/src/libcore/priv.rs index b8e0848dc87..90fc9239e14 100644 --- a/src/libcore/priv.rs +++ b/src/libcore/priv.rs @@ -1,6 +1,6 @@ #[doc(hidden)]; -export chan_from_global_ptr; +export chan_from_global_ptr, weaken_task; import compare_and_swap = rustrt::rust_compare_and_swap_ptr; @@ -32,8 +32,11 @@ unsafe fn chan_from_global_ptr<T: send>( abort } + log(debug,"ENTERING chan_from_global_ptr, before is_prob_zero check"); let is_probably_zero = *global == 0u; + log(debug,"after is_prob_zero check"); if is_probably_zero { + log(debug,"is probably zero..."); // There's no global channel. We must make it let setup_po = comm::port(); @@ -51,14 +54,17 @@ unsafe fn chan_from_global_ptr<T: send>( } }; + log(debug,"before setup recv.."); // This is the proposed global channel let ch = comm::recv(setup_po); // 0 is our sentinal value. It is not a valid channel assert unsafe::reinterpret_cast(ch) != 0u; // Install the channel + log(debug,"BEFORE COMPARE AND SWAP"); let swapped = compare_and_swap( global, 0u, unsafe::reinterpret_cast(ch)); + log(debug,#fmt("AFTER .. swapped? %?", swapped)); if swapped { // Success! @@ -70,6 +76,7 @@ unsafe fn chan_from_global_ptr<T: send>( unsafe::reinterpret_cast(*global) } } else { + log(debug, "global != 0"); unsafe::reinterpret_cast(*global) } } |
