shithub: riscv

Download patch

ref: ffa430c57068e65f5247f22a862a78ed11f9da18
parent: b24ebff76a1d0ef99ecef551a78288642e6ea35b
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sun Mar 12 17:29:28 EDT 2017

upas/fs: lock mbox in syncallmboxes() to avoid assert crash

--- a/sys/src/cmd/upas/fs/mbox.c
+++ b/sys/src/cmd/upas/fs/mbox.c
@@ -273,9 +273,12 @@
 	Mailbox *m;
 
 	qlock(&mbllock);
-	for(m = mbl; m != nil; m = m->next)
+	for(m = mbl; m != nil; m = m->next){
+		qlock(m);
 		if(err = syncmbox(m, 1))
 			eprint("syncmbox: %s\n", err);
+		qunlock(m);
+	}
 	qunlock(&mbllock);
 }