diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-08-10 03:52:40 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-08-10 03:52:40 +0200 |
commit | 4b926f4e6955e0d376c38559606d670a637dac88 (patch) | |
tree | 21dc1a0f4d4c21ada6f608be144277bb9e5cfb4f /sys/src/lib9p | |
parent | c23504631008ce0bfaa5bec48acb2b04f4b49fd9 (diff) |
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.
Diffstat (limited to 'sys/src/lib9p')
-rw-r--r-- | sys/src/lib9p/queue.c | 16 |
1 files changed, 4 insertions, 12 deletions
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{ |