commit 91ececc99741b3111c69d455bc928e871b15d766 from: Russ Cox date: Wed Dec 30 13:41:01 2020 UTC libthread: drop schedlock Having two locks in the proc was causing deadlocks. commit - 4692dd4786f8847494d3f020bc3c05ba210adc0d commit + 91ececc99741b3111c69d455bc928e871b15d766 blob - d72bf896df49831c4b3d5bdedb397c98ea25c4ae blob + 79e0ec71f81ed265eaf0378c38643892cae03fab --- src/libthread/thread.c +++ src/libthread/thread.c @@ -281,7 +281,7 @@ static void pthreadwakeupschedlocked(Proc *p, _Thread *self, _Thread *t) { _threaddebug(self, "pthreadwakeupschedlocked %p %d", p, t->id);; - t->schedrend.l = &p->schedlock; + t->schedrend.l = &p->lock; p->schedthread = t; _procwakeup(&t->schedrend); } blob - 9eddba21f316307703b742406b369dd2c0843d96 blob + fd40f25289c64fd2613ff48ed431596971acdfd7 --- src/libthread/threadimpl.h +++ src/libthread/threadimpl.h @@ -88,7 +88,6 @@ struct Proc uint nthread; uint sysproc; _Procrendez runrend; - Lock schedlock; _Thread *schedthread; void *udata; Jmp sigjmp;