Skip to content

Commit a195832

Browse files
committed
---
yaml --- r: 143013 b: refs/heads/try2 c: 9bbec65 h: refs/heads/master i: 143011: d364bd4 v: v3
1 parent f40b2b4 commit a195832

File tree

4 files changed

+220
-129
lines changed

4 files changed

+220
-129
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: e2a42416ddab88f7ed076cb9a4fd6ecc70be3278
8+
refs/heads/try2: 9bbec651dfff68c93d7213fceadecc21c324b0cb
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libstd/rt/kill.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use either::{Either, Left, Right};
1616
use option::{Option, Some, None};
1717
use prelude::*;
1818
use rt::task::Task;
19+
use to_bytes::IterBytes;
1920
use unstable::atomics::{AtomicUint, Acquire, SeqCst};
2021
use unstable::sync::{UnsafeAtomicRcBox, LittleLock};
2122
use util;
@@ -194,6 +195,17 @@ impl BlockedTask {
194195
}
195196
}
196197

198+
// So that KillHandle can be hashed in the taskgroup bookkeeping code.
199+
impl IterBytes for KillHandle {
200+
fn iter_bytes(&self, lsb0: bool, f: &fn(buf: &[u8]) -> bool) -> bool {
201+
self.data.iter_bytes(lsb0, f)
202+
}
203+
}
204+
impl Eq for KillHandle {
205+
#[inline] fn eq(&self, other: &KillHandle) -> bool { self.data.eq(&other.data) }
206+
#[inline] fn ne(&self, other: &KillHandle) -> bool { self.data.ne(&other.data) }
207+
}
208+
197209
impl KillHandle {
198210
pub fn new() -> (KillHandle, KillFlagHandle) {
199211
let (flag, flag_clone) =

branches/try2/src/libstd/rt/task.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ use super::local_heap::LocalHeap;
2727
use rt::sched::{Scheduler, SchedHandle};
2828
use rt::stack::{StackSegment, StackPool};
2929
use rt::context::Context;
30+
use task::spawn::TCB;
3031
use cell::Cell;
3132

3233
pub struct Task {
@@ -36,6 +37,7 @@ pub struct Task {
3637
logger: StdErrLogger,
3738
unwinder: Unwinder,
3839
home: Option<SchedHome>,
40+
taskgroup: Option<TCB>,
3941
death: Death,
4042
destroyed: bool,
4143
coroutine: Option<~Coroutine>
@@ -85,6 +87,7 @@ impl Task {
8587
logger: StdErrLogger,
8688
unwinder: Unwinder { unwinding: false },
8789
home: Some(home),
90+
taskgroup: None,
8891
death: Death::new(),
8992
destroyed: false,
9093
coroutine: Some(~Coroutine::new(stack_pool, start))
@@ -102,6 +105,7 @@ impl Task {
102105
logger: StdErrLogger,
103106
home: Some(home),
104107
unwinder: Unwinder { unwinding: false },
108+
taskgroup: None,
105109
// FIXME(#7544) make watching optional
106110
death: self.death.new_child(),
107111
destroyed: false,
@@ -121,6 +125,7 @@ impl Task {
121125
}
122126

123127
self.unwinder.try(f);
128+
{ let _ = self.taskgroup.take(); }
124129
self.death.collect_failure(!self.unwinder.unwinding);
125130
self.destroy();
126131
}

0 commit comments

Comments
 (0)