From 481b596d9389076d686832e0a3c26fc7b550c532 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Mon, 13 Jan 2020 23:26:26 -0500 Subject: libthread: fix fault in teardown of proc Fixes #332. --- src/libthread/thread.c | 1 + src/libthread/threadimpl.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/libthread/thread.c b/src/libthread/thread.c index c84af855..d041efcc 100644 --- a/src/libthread/thread.c +++ b/src/libthread/thread.c @@ -429,6 +429,7 @@ Out: unlock(&p->lock); _threadsetproc(nil); free(p); + _threadpexit(); } void diff --git a/src/libthread/threadimpl.h b/src/libthread/threadimpl.h index 437503c6..76ca57e5 100644 --- a/src/libthread/threadimpl.h +++ b/src/libthread/threadimpl.h @@ -197,7 +197,7 @@ extern Channel *_dowaitchan; extern void _procstart(Proc*, void (*fn)(Proc*)); extern _Thread *_threadcreate(Proc*, void(*fn)(void*), void*, uint); -extern void _threadexit(void); +extern void _procexit(void); extern Proc *_threadproc(void); extern void _threadsetproc(Proc*); extern int _threadlock(Lock*, int, ulong); -- cgit v1.2.3