Skip to content

Commit 24bd49d

Browse files
committed
---
yaml --- r: 23246 b: refs/heads/master c: 00ef541 h: refs/heads/master v: v3
1 parent 2270552 commit 24bd49d

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
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: a57d3e0c152a293885f65cdf44d4b98a5e2f71cc
2+
refs/heads/master: 00ef5418d44a191b464db87b99d8034202c86c7d
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be

trunk/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)