diff options
author | Valery Ushakov <uwe@stderr.spb.ru> | 2019-03-09 22:03:59 +0300 |
---|---|---|
committer | Valery Ushakov <uwe@stderr.spb.ru> | 2019-03-09 22:03:59 +0300 |
commit | 9b7850d511c2c910abfb42ece20650b97fba5a72 (patch) | |
tree | b8d3eff06cb352ade2bddcb4043c1b1762671675 | |
parent | cd4ca1116680f235d174415e18ec972c4000fffd (diff) |
Work around a problem on macppc with kernel semaphores.
NetBSD/macppc 7 and later seems to have a bug in kernel based pthread
semaphores. When running emu interactively shell would forever hang
in sem_wait() after the first interactive command.
I added sem_getvalue() after sem_init() as a debugging aid to get the
semaphore id in ktrace output and it magically fixed the problem. For
now just leave it here as a workaround under appropriate ifdef.
-rw-r--r-- | emu/port/kproc-pthreads.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/emu/port/kproc-pthreads.c b/emu/port/kproc-pthreads.c index a15a7cd3..c6caded6 100644 --- a/emu/port/kproc-pthreads.c +++ b/emu/port/kproc-pthreads.c @@ -122,6 +122,12 @@ kproc(char *name, void (*func)(void*), void *arg, int flags) panic("kproc: no memory"); os->self = 0; /* set by tramp */ sem_init(&os->sem, 0, 0); +#if defined(__NetBSD__) && defined(__powerpc__) + { /* XXX: Work around a problem on macppc with kernel semaphores. */ + int val; + sem_getvalue(&os->sem, &val); + } +#endif p->os = os; if(flags & KPDUPPG) { |