tNoblock is nonsense. - plan9port - [fork] Plan 9 from user space
(HTM) git clone git://src.adamsgaard.dk/plan9port
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 30387d7ba615e35e72e433df15fed2e918debf61
(DIR) parent c4097c29512269f4547ebefb8abdc57a2892b479
(HTM) Author: rsc <devnull@localhost>
Date: Wed, 12 May 2004 18:22:54 +0000
Noblock is nonsense.
Diffstat:
M src/libthread/fdwait.c | 19 -------------------
1 file changed, 0 insertions(+), 19 deletions(-)
---
(DIR) diff --git a/src/libthread/fdwait.c b/src/libthread/fdwait.c
t@@ -8,7 +8,6 @@
#include <fcntl.h>
#define debugpoll 0
-static int noblocked[4096/32];
#ifdef __APPLE__
#include <sys/time.h>
t@@ -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