shithub: Nail

Download patch

ref: 1b2c1454a339e5fc8a1a619fe50031e2d2741d01
parent: 4c6e2de2a31fc281f2bc1c12b1799c7af46922a6
author: Ori Bernstein <ori@eigenstate.org>
date: Sat Nov 7 20:12:07 EST 2020

add mbox to thread names

--- a/comp.c
+++ b/comp.c
@@ -143,6 +143,7 @@
 			break;
 		}
 	mbox.nopen--;
+	c->qnext = nil;
 	winclose(c);
 	free(c->replyto);
 	free(c->rname);
--- a/mbox.c
+++ b/mbox.c
@@ -57,7 +57,7 @@
 static void
 plumbshowmail(void*)
 {
-	threadsetname("plumbshow");
+	threadsetname("plumbshow %s", mbox.path);
 	plumbloop(mbox.show, plumbshowmailfd);
 }
 
@@ -64,7 +64,7 @@
 static void
 plumbseemail(void*)
 {
-	threadsetname("plumbsee");
+	threadsetname("plumbsee %s", mbox.path);
 	plumbloop(mbox.see, plumbseemailfd);
 }
 
@@ -71,7 +71,7 @@
 static void
 plumbsendmail(void*)
 {
-	threadsetname("plumbsend");
+	threadsetname("plumbsend %s", mbox.path);
 	plumbloop(mbox.send, plumbsendmailfd);
 }
 
@@ -80,7 +80,7 @@
 {
 	Event *ev;
 
-	threadsetname("mbevent");
+	threadsetname("mbevent %s", mbox.path);
 	while(1){
 		ev = emalloc(sizeof(Event));
 		if(winevent(&mbox, ev) == -1)
--- a/mesg.c
+++ b/mesg.c
@@ -403,6 +403,7 @@
 			break;
 		}
 	mbox.nopen--;
+	m->qnext = nil;
 	m->flags &= ~Fopen;
 	winclose(m);
 	threadexits(nil);