fix threadsetname usage in few places

This commit is contained in:
ftrvxmtrx 2014-05-03 13:07:52 +02:00
parent 6f58f7fed4
commit d2c3185bfa
7 changed files with 15 additions and 47 deletions

View file

@ -215,11 +215,9 @@ readthread(void *a)
Client *c;
Ioproc *io;
Msg *m;
char tmp[32];
c = a;
snprint(tmp, sizeof tmp, "read%d", c->num);
threadsetname(tmp);
threadsetname("read%d", c->num);
buf = emalloc(8192);
io = c->readerproc;
@ -279,11 +277,9 @@ writethread(void *a)
Ioproc *io;
Req *r;
Client *c;
char tmp[32];
c = a;
snprint(tmp, sizeof tmp, "write%d", c->num);
threadsetname(tmp);
threadsetname("write%d", c->num);
buf = emalloc(8192);
io = c->writerproc;
@ -320,11 +316,9 @@ execproc(void *a)
{
int i, fd;
Client *c;
char tmp[32];
c = a;
snprint(tmp, sizeof tmp, "execproc%d", c->num);
threadsetname(tmp);
threadsetname("execproc%d", c->num);
if(pipe(c->fd) < 0){
rerrstr(c->err, sizeof c->err);
sendul(c->execpid, -1);
@ -346,11 +340,9 @@ execthread(void *a)
{
Client *c;
int p;
char tmp[32];
c = a;
snprint(tmp, sizeof tmp, "exec%d", c->num);
threadsetname(tmp);
threadsetname("exec%d", c->num);
c->execpid = chancreate(sizeof(ulong), 0);
proccreate(execproc, c, STACK);
p = recvul(c->execpid);

View file

@ -171,7 +171,7 @@ download(void *aux)
if((c = f->c) == nil)
goto out;
threadsetname(f->path);
threadsetname("%s", f->path);
snprint(buf, sizeof(buf), "%s/udp!*!0", net);
if((cfd = announce(buf, adir)) < 0){

View file

@ -228,14 +228,6 @@ setproto(KDev *f, int eid)
return usbcmd(f->dev, Rh2d|Rclass|Riface, Setproto, proto, id, nil, 0);
}
static void
kbprocname(KDev *kd, char *name)
{
char buf[128];
snprint(buf, sizeof(buf), "%s %s", name, kd->ep->dir);
threadsetname(buf);
}
static void
sethipri(void)
{
@ -324,7 +316,7 @@ joywork(void *a)
Joy p;
u64int lastb;
kbprocname(f, "joy");
threadsetname("joy %s", f->ep->dir);
sethipri();
memset(&p, 0, sizeof(p));

View file

@ -336,14 +336,6 @@ kbfatal(KDev *kd, char *sts)
threadexits(sts);
}
static void
kbprocname(KDev *kd, char *name)
{
char buf[128];
snprint(buf, sizeof(buf), "%s %s", name, kd->ep->dir);
threadsetname(buf);
}
static void
sethipri(void)
{
@ -465,7 +457,7 @@ ptrwork(void* a)
KDev* f = a;
Ptr p;
kbprocname(f, "ptr");
threadsetname("ptr %s", f->ep->dir);
sethipri();
memset(&p, 0, sizeof(p));
@ -698,7 +690,7 @@ kbdwork(void *a)
char err[128];
KDev *f = a;
kbprocname(f, "kbd");
threadsetname("kbd %s", f->ep->dir);
f->repeatc = chancreate(sizeof(ulong), 0);
if(f->repeatc == nil)

View file

@ -180,12 +180,11 @@ winctl(void *arg)
Stringpair pair;
Wctlmesg wcm;
Completion *cr;
char buf[4*12+1], *kbdq[8], *kbds;
char *kbdq[8], *kbds;
int kbdqr, kbdqw;
w = arg;
snprint(buf, sizeof buf, "winctl-id%d", w->id);
threadsetname(buf);
threadsetname("winctl-id%d", w->id);
mrm.cm = chancreate(sizeof(Mouse), 0);
krm.ck = chancreate(sizeof(char*), 0);
@ -540,11 +539,9 @@ completeproc(void *arg)
{
Completejob *job;
Completion *c;
char buf[128];
job = arg;
snprint(buf, sizeof(buf), "namecomplete %s", job->dir);
threadsetname(buf);
threadsetname("namecomplete %s", job->dir);
c = complete(job->dir, job->str);
if(c != nil && sendp(job->win->complete, c) <= 0)

View file

@ -99,11 +99,9 @@ xfidctl(void *arg)
{
Xfid *x;
void (*f)(Xfid*);
char buf[64];
x = arg;
snprint(buf, sizeof buf, "xfid.%p", x);
threadsetname(buf);
threadsetname("xfid.%p", x);
for(;;){
f = recvp(x->c);
if(f){

View file

@ -160,12 +160,11 @@ controlsetthread(void *v)
Control *f;
int prevbut, n, i;
Alt alts[NALT+1];
char tmp[64], *str;
char *str;
Rune buf[2][20], *rp;
cs = v;
snprint(tmp, sizeof tmp, "controlsetthread 0x%p", cs);
threadsetname(tmp);
threadsetname("controlsetthread 0x%p", cs);
alts[AKey].c = cs->kbdc;
alts[AKey].v = &rp;
@ -619,12 +618,10 @@ static void
resizethread(void *v)
{
Controlset *cs;
char buf[64];
Alt alts[3];
cs = v;
snprint(buf, sizeof buf, "resizethread0x%p", cs);
threadsetname(buf);
threadsetname("resizethread 0x%p", cs);
alts[0].c = cs->resizec;
alts[0].v = nil;