changeset: 71:f051bd21359b
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Sun Jul 01 17:18:29 2007 -0400
summary: Add select to the threading stubs. I fear I'll need it.
diff -r be114f741413 -r f051bd21359b include/ixp.h
--- a/include/ixp.h Sun Jul 01 17:09:14 2007 -0400
+++ b/include/ixp.h Sun Jul 01 17:18:29 2007 -0400
@@ -394,6 +394,7 @@ struct IxpThread {
char *(*errbuf)(void);
ssize_t (*read)(int, void*, size_t);
ssize_t (*write)(int, const void*, size_t);
+ int (*select)(int, fd_set*, fd_set*, fd_set*, struct timeval*);
};
extern IxpThread *ixp_thread;
diff -r be114f741413 -r f051bd21359b libixp/server.c
--- a/libixp/server.c Sun Jul 01 17:09:14 2007 -0400
+++ b/libixp/server.c Sun Jul 01 17:18:29 2007 -0400
@@ -79,7 +79,7 @@ ixp_serverloop(IxpServer *s) {
if(s->preselect)
s->preselect(s);
prepare_select(s);
- r = select(s->maxfd + 1, &s->rd, 0, 0, 0);
+ r = thread->select(s->maxfd + 1, &s->rd, 0, 0, 0);
if(r < 0) {
if(errno == EINTR)
continue;
diff -r be114f741413 -r f051bd21359b libixp_pthread/thread_pthread.c
--- a/libixp_pthread/thread_pthread.c Sun Jul 01 17:09:14 2007 -0400
+++ b/libixp_pthread/thread_pthread.c Sun Jul 01 17:18:29 2007 -0400
@@ -177,5 +177,6 @@ static IxpThread ixp_pthread = {
.errbuf = errbuf,
.read = read,
.write = write,
+ .select = select,
};
diff -r be114f741413 -r f051bd21359b libixp_rubythread/thread_ruby.c
--- a/libixp_rubythread/thread_ruby.c Sun Jul 01 17:09:14 2007 -0400
+++ b/libixp_rubythread/thread_ruby.c Sun Jul 01 17:18:29 2007 -0400
@@ -179,6 +179,7 @@ static IxpThread ixp_rthread = {
.errbuf = errbuf,
.read = _read,
.write = _write,
+ .select = rb_thread_select,
};
static char RWLock[] =
diff -r be114f741413 -r f051bd21359b libixp_task/thread_task.c
--- a/libixp_task/thread_task.c Sun Jul 01 17:09:14 2007 -0400
+++ b/libixp_task/thread_task.c Sun Jul 01 17:18:29 2007 -0400
@@ -172,5 +172,6 @@ static IxpThread ixp_task = {
.errbuf = errbuf,
.read = _read,
.write = _write,
+ .select = select, /* wrong */
};
Received on Sun Jul 01 2007 - 23:21:20 UTC
This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:57:28 UTC