ref: 4b926f4e6955e0d376c38559606d670a637dac88
parent: c23504631008ce0bfaa5bec48acb2b04f4b49fd9
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sun Aug 9 23:52:40 EDT 2015
lib9p: make reqqueueflush() use new threadint(), which will also cover channel operations using "interrupt" ctl message directly doesnt work when the process is doing libthread channel operations (threadrendezvous) as it will just repeat a interrupted rendezvous(). threadint() handles this for us.
--- a/sys/src/lib9p/queue.c
+++ b/sys/src/lib9p/queue.c
@@ -12,10 +12,10 @@
void (*f)(Req *);
int fd;
char *buf;
-
+
q = v;
rfork(RFNOTEG);
-
+
buf = smprint("/proc/%d/ctl", getpid());
fd = open(buf, OWRITE);
free(buf);
@@ -48,7 +48,7 @@
memset(q, 0, sizeof(*q));
q->l = q;
q->next = q->prev = q;
- q->pid = threadpid(proccreate(_reqqueueproc, q, mainstacksize));
+ q->pid = proccreate(_reqqueueproc, q, mainstacksize);
return q;
}
@@ -68,17 +68,9 @@
void
reqqueueflush(Reqqueue *q, Req *r)
{
- char buf[128];
- int fd;
-
qlock(q);
if(q->cur == r){
- sprint(buf, "/proc/%d/ctl", q->pid);
- fd = open(buf, OWRITE);
- if(fd >= 0){
- write(fd, "interrupt", 9);
- close(fd);
- }
+ threadint(q->pid);
q->flush++;
qunlock(q);
}else{