change to use new thread library

This commit is contained in:
rsc 2004-12-27 19:13:15 +00:00
parent 1d011ae242
commit b3efcdbf59

View file

@ -6,7 +6,7 @@
#include "plumb.h" #include "plumb.h"
Plumbmsg* Plumbmsg*
threadplumbrecv(int fd) ioplumbrecv(Ioproc *io, int fd)
{ {
char *buf; char *buf;
Plumbmsg *m; Plumbmsg *m;
@ -15,7 +15,7 @@ threadplumbrecv(int fd)
buf = malloc(8192); buf = malloc(8192);
if(buf == nil) if(buf == nil)
return nil; return nil;
n = threadread(fd, buf, 8192); n = ioread(io, fd, buf, 8192);
m = nil; m = nil;
if(n > 0){ if(n > 0){
m = plumbunpackpartial(buf, n, &more); m = plumbunpackpartial(buf, n, &more);
@ -24,7 +24,7 @@ threadplumbrecv(int fd)
buf = realloc(buf, n+more); buf = realloc(buf, n+more);
if(buf == nil) if(buf == nil)
return nil; return nil;
if(threadreadn(fd, buf+n, more) == more) if(ioreadn(io, fd, buf+n, more) == more)
m = plumbunpackpartial(buf, n+more, nil); m = plumbunpackpartial(buf, n+more, nil);
} }
} }