commit 30387d7ba615e35e72e433df15fed2e918debf61 from: rsc date: Wed May 12 18:22:54 2004 UTC Noblock is nonsense. commit - c4097c29512269f4547ebefb8abdc57a2892b479 commit + 30387d7ba615e35e72e433df15fed2e918debf61 blob - a6890332e0ef859bb1d1be557c406f89c2ff0b84 blob + e583da60dc84a41c793be690bc67387c01ff9592 --- src/libthread/fdwait.c +++ src/libthread/fdwait.c @@ -8,7 +8,6 @@ #include #define debugpoll 0 -static int noblocked[4096/32]; #ifdef __APPLE__ #include @@ -228,25 +227,7 @@ threadsleep(int ms) void threadfdnoblock(int fd) { - Thread *t; - - if(fd<0) - return; - if(fd < 8*sizeof(int)*nelem(noblocked) - && (noblocked[fd/(8*sizeof(int))] & (1<<(fd%(8*sizeof(int)))))) - return; - t = _threadgetproc()->thread; - if(t && t->lastfd == fd) - return; fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0)|O_NONBLOCK); - if(t) - t->lastfd = fd; - - /* We could lock this but we're probably single-threaded - * and the worst that will happen is we'll run fcntl - * a few more times. - */ - noblocked[fd/(8*sizeof(int))] |= 1<<(fd%(8*sizeof(int))); } long