From 8a39ee361feb9bf46d728ff1ba4f07ca1d9610b1 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Thu, 19 Jun 2014 09:22:53 +0200 Subject: Imported Upstream version 1.3 --- src/pkg/runtime/parfor.c | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) (limited to 'src/pkg/runtime/parfor.c') diff --git a/src/pkg/runtime/parfor.c b/src/pkg/runtime/parfor.c index ceaac8bc9..4706e0a43 100644 --- a/src/pkg/runtime/parfor.c +++ b/src/pkg/runtime/parfor.c @@ -33,15 +33,6 @@ runtime·parforalloc(uint32 nthrmax) return desc; } -// For testing from Go -// func parforalloc2(nthrmax uint32) *ParFor -void -runtime·parforalloc2(uint32 nthrmax, ParFor *desc) -{ - desc = runtime·parforalloc(nthrmax); - FLUSH(&desc); -} - void runtime·parforsetup(ParFor *desc, uint32 nthr, uint32 n, void *ctx, bool wait, void (*body)(ParFor*, uint32)) { @@ -75,14 +66,6 @@ runtime·parforsetup(ParFor *desc, uint32 nthr, uint32 n, void *ctx, bool wait, } } -// For testing from Go -// func parforsetup2(desc *ParFor, nthr, n uint32, ctx *byte, wait bool, body func(*ParFor, uint32)) -void -runtime·parforsetup2(ParFor *desc, uint32 nthr, uint32 n, void *ctx, bool wait, void *body) -{ - runtime·parforsetup(desc, nthr, n, ctx, wait, *(void(**)(ParFor*, uint32))body); -} - void runtime·parfordo(ParFor *desc) { @@ -207,13 +190,10 @@ exit: me->nsleep = 0; } -// For testing from Go -// func parforiters(desc *ParFor, tid uintptr) (uintptr, uintptr) +// For testing from Go. void -runtime·parforiters(ParFor *desc, uintptr tid, uintptr start, uintptr end) +runtime·parforiters(ParFor *desc, uintptr tid, uintptr *start, uintptr *end) { - start = (uint32)desc->thr[tid].pos; - end = (uint32)(desc->thr[tid].pos>>32); - FLUSH(&start); - FLUSH(&end); + *start = (uint32)desc->thr[tid].pos; + *end = (uint32)(desc->thr[tid].pos>>32); } -- cgit v1.2.3