static void dbgproc(void *) { Dbgkey *dp; setpri(PriRealtime); for (;;) { do { rendez_sleep(&dbg, dbgwork, 0); dp = dbg.work; } while (dp == NULL); dp->f(dp->r); dbg.work = NULL; } }
static void dbgproc(void *) { Dbgkey *dp; setpri(PriRealtime); for(;;) { do { sleep(&dbg, dbgwork, 0); dp = dbg.work; } while(dp == nil); dp->f(dp->r); dbg.work = nil; } }
static int isdbgkey(Rune r) { static int ctrlt; Dbgkey *dp; int echoctrlt = ctrlt; /* * ^t hack BUG */ if(dbg.on || (ctrlt >= 2)) { if(r == 0x14 || r == 0x05) { ctrlt++; return 0; } if(dp = finddbgkey(r)) { if(dp->i || ctrlt > 2) dp->f(r); else { dbg.work = dp; wakeup(&dbg); } ctrlt = 0; return 1; } ctrlt = 0; } else if(r == 0x14){ ctrlt++; return 1; } else ctrlt = 0; if(echoctrlt){ char buf[3]; buf[0] = 0x14; while(--echoctrlt >= 0){ echo(buf[0], buf, 1); qproduce(kbdq, buf, 1); } } return 0; }