diff options
Diffstat (limited to 'libgo/runtime/runtime.h')
-rw-r--r-- | libgo/runtime/runtime.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/libgo/runtime/runtime.h b/libgo/runtime/runtime.h index b9264236227..cbf1fe160b9 100644 --- a/libgo/runtime/runtime.h +++ b/libgo/runtime/runtime.h @@ -421,17 +421,15 @@ struct LFNode // Parallel for descriptor. struct ParFor { - void (*body)(ParFor*, uint32); // executed for each element + const FuncVal *body; // executed for each element uint32 done; // number of idle threads uint32 nthr; // total number of threads uint32 nthrmax; // maximum number of threads uint32 thrseq; // thread id sequencer uint32 cnt; // iteration space [0, cnt) - void *ctx; // arbitrary user context bool wait; // if true, wait while all threads finish processing, // otherwise parfor may return while other threads are still working ParForThread *thr; // array of thread descriptors - uint32 pad; // to align ParForThread.pos for 64-bit atomic operations // stats uint64 nsteal; uint64 nstealcnt; @@ -544,6 +542,7 @@ void runtime_schedinit(void); void runtime_initsig(void); void runtime_sigenable(uint32 sig); void runtime_sigdisable(uint32 sig); +void runtime_sigignore(uint32 sig); int32 runtime_gotraceback(bool *crash); void runtime_goroutineheader(G*); void runtime_printtrace(Location*, int32, bool); @@ -552,8 +551,8 @@ void runtime_printtrace(Location*, int32, bool); #define runtime_write(d, v, n) write((d), (v), (n)) #define runtime_close(d) close(d) void runtime_ready(G*); -const byte* runtime_getenv(const char*); -int32 runtime_atoi(const byte*); +String runtime_getenv(const char*); +int32 runtime_atoi(const byte*, intgo); void* runtime_mstart(void*); G* runtime_malg(int32, byte**, size_t*); void runtime_mpreinit(M*); @@ -713,12 +712,11 @@ LFNode* runtime_lfstackpop(uint64 *head); * Parallel for over [0, n). * body() is executed for each iteration. * nthr - total number of worker threads. - * ctx - arbitrary user context. * if wait=true, threads return from parfor() when all work is done; * otherwise, threads can return while other threads are still finishing processing. */ ParFor* runtime_parforalloc(uint32 nthrmax); -void runtime_parforsetup(ParFor *desc, uint32 nthr, uint32 n, void *ctx, bool wait, void (*body)(ParFor*, uint32)); +void runtime_parforsetup(ParFor *desc, uint32 nthr, uint32 n, bool wait, const FuncVal *body); void runtime_parfordo(ParFor *desc); void runtime_parforiters(ParFor*, uintptr, uintptr*, uintptr*); |