diff options
Diffstat (limited to 'concurrency.c')
-rw-r--r-- | concurrency.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/concurrency.c b/concurrency.c index 80b9920..b49b43a 100644 --- a/concurrency.c +++ b/concurrency.c @@ -65,6 +65,7 @@ spawnthread(Function f, Array *name, Array *left, Array *right) Channel *setupdone = chancreate(sizeof(int), 0); SpawnData *sp = emalloc(sizeof(SpawnData)); sp->func = dupfunction(f); + sp->func.scope = dupscope(f.scope); sp->name = duparray(name); sp->left = left ? duparray(left) : nil; sp->right = duparray(right); @@ -192,12 +193,6 @@ newprocfn(void *data) ErrorGuard *eg = newerrorguard(mkscalarint(0), nil); /* make a catch-all error guard */ if(setjmp(eg->jmp)) displayerror(); - /* print("Thread %d: %S%S%S\n", - threadid(), - errorstr(td->lasterror), - (td->lasterror && td->lasterrormsg) ? L": " : L"", - td->lasterrormsg ? td->lasterrormsg : L""); - */ else{ int done = 1; send(sp->setupdone, &done); @@ -217,6 +212,7 @@ newprocfn(void *data) freearray(sp->name); freearray(sp->left); freearray(sp->right); + freedfnframe(sp->func.scope, 0); freefunction(sp->func); free(sp); free(td); |