code: plan9front

Download patch

ref: 02015f69f6cf7630015f26b349076fe7b9e76de1
parent: 692023ee08786ad834e03f5f271c20ce50feee3a
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Wed Jan 3 23:22:04 EST 2024

kernel: make sure process is in Queueing state in qunlock()

--- a/sys/src/9/port/qlock.c
+++ b/sys/src/9/port/qlock.c
@@ -134,6 +134,8 @@
 			getcallerpc(&q));
 	p = q->head;
 	if(p != nil){
+		if(p->state != Queueing)
+			panic("qunlock");
 		q->pc = p->qpc;
 		q->head = p->qnext;
 		if(q->head == nil)