summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/src/libthread/kill.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/src/libthread/kill.c b/sys/src/libthread/kill.c
index 46c442066..9160df016 100644
--- a/sys/src/libthread/kill.c
+++ b/sys/src/libthread/kill.c
@@ -79,8 +79,20 @@ threadint(int id)
static void
tinterrupt(Proc *p, Thread *t)
{
+ char buf[64];
+ int fd;
+
switch(t->state){
case Running:
+ snprint(buf, sizeof(buf), "/proc/%d/ctl", p->pid);
+ fd = open(buf, OWRITE|OCEXEC);
+ if(fd >= 0){
+ if(write(fd, "interrupt", 9) == 9){
+ close(fd);
+ break;
+ }
+ close(fd);
+ }
postnote(PNPROC, p->pid, "threadint");
break;
case Rendezvous: