From 4b926f4e6955e0d376c38559606d670a637dac88 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Mon, 10 Aug 2015 03:52:40 +0200 Subject: 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. --- sys/src/lib9p/queue.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'sys/src/lib9p/queue.c') diff --git a/sys/src/lib9p/queue.c b/sys/src/lib9p/queue.c index c0b52f94e..971e8a78d 100644 --- a/sys/src/lib9p/queue.c +++ b/sys/src/lib9p/queue.c @@ -12,10 +12,10 @@ _reqqueueproc(void *v) 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 @@ reqqueuecreate(void) 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 @@ reqqueuepush(Reqqueue *q, Req *r, void (*f)(Req *)) 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{ -- cgit v1.2.3