Skip to content

Commit b19cdd9

Browse files
committed
---
yaml --- r: 29846 b: refs/heads/incoming c: 00ef541 h: refs/heads/master v: v3
1 parent f22b7f8 commit b19cdd9

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
9-
refs/heads/incoming: a57d3e0c152a293885f65cdf44d4b98a5e2f71cc
9+
refs/heads/incoming: 00ef5418d44a191b464db87b99d8034202c86c7d
1010
refs/heads/dist-snap: 2f32a1581f522e524009138b33b1c7049ced668d
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/src/libcore/task.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,9 +1025,9 @@ fn kill_taskgroup(state: taskgroup_inner, me: *rust_task, is_main: bool) {
10251025

10261026
// FIXME (#2912): Work around core-vs-coretest function duplication. Can't use
10271027
// a proper closure because the #[test]s won't understand. Have to fake it.
1028-
unsafe fn taskgroup_key() -> local_data_key<tcb> {
1028+
macro_rules! taskgroup_key {
10291029
// Use a "code pointer" value that will never be a real code pointer.
1030-
unsafe::transmute((-2 as uint, 0u))
1030+
{} => (unsafe::transmute((-2 as uint, 0u)))
10311031
}
10321032

10331033
fn gen_child_taskgroup(linked: bool, supervised: bool)
@@ -1036,7 +1036,8 @@ fn gen_child_taskgroup(linked: bool, supervised: bool)
10361036
/*######################################################################*
10371037
* Step 1. Get spawner's taskgroup info.
10381038
*######################################################################*/
1039-
let spawner_group = match unsafe { local_get(spawner, taskgroup_key()) } {
1039+
let spawner_group = match unsafe { local_get(spawner,
1040+
taskgroup_key!()) } {
10401041
none => {
10411042
// Main task, doing first spawn ever. Lazily initialise here.
10421043
let mut members = new_taskset();
@@ -1047,7 +1048,7 @@ fn gen_child_taskgroup(linked: bool, supervised: bool)
10471048
// Main task/group has no ancestors, no notifier, etc.
10481049
let group =
10491050
@tcb(spawner, tasks, ancestor_list(none), true, none);
1050-
unsafe { local_set(spawner, taskgroup_key(), group); }
1051+
unsafe { local_set(spawner, taskgroup_key!(), group); }
10511052
group
10521053
}
10531054
some(group) => group
@@ -1162,7 +1163,7 @@ fn spawn_raw(+opts: task_opts, +f: fn~()) {
11621163
if enlist_many(child, child_arc, &mut ancestors) {
11631164
let group = @tcb(child, child_arc, ancestors,
11641165
is_main, notifier);
1165-
unsafe { local_set(child, taskgroup_key(), group); }
1166+
unsafe { local_set(child, taskgroup_key!(), group); }
11661167
// Run the child's body.
11671168
f();
11681169
// TLS cleanup code will exit the taskgroup.
@@ -1261,7 +1262,7 @@ fn spawn_raw(+opts: task_opts, +f: fn~()) {
12611262
*
12621263
* These two cases aside, the interface is safe.
12631264
*/
1264-
type local_data_key<T: owned> = fn@(+@T);
1265+
type local_data_key<T: owned> = &fn(+@T);
12651266

12661267
trait local_data { }
12671268
impl<T: owned> @T: local_data { }

0 commit comments

Comments
 (0)