libixp

git clone git://oldgit.suckless.org/libixp/
Log | Files | Refs | LICENSE

commit 6e0e9c00074462f4e904270edb156d9914df9193
parent beac8507376d3441b05842378e24ee679c8c6741
Author: Kris Maglione <jg@suckless.org>
Date:   Sun,  1 Jul 2007 17:18:29 -0400

Add select to the threading stubs. I fear I'll need it.

Diffstat:
include/ixp.h | 1+
libixp/server.c | 2+-
libixp_pthread/thread_pthread.c | 1+
libixp_rubythread/thread_ruby.c | 1+
libixp_task/thread_task.c | 1+
5 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/include/ixp.h b/include/ixp.h @@ -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 --git a/libixp/server.c b/libixp/server.c @@ -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 --git a/libixp_pthread/thread_pthread.c b/libixp_pthread/thread_pthread.c @@ -177,5 +177,6 @@ static IxpThread ixp_pthread = { .errbuf = errbuf, .read = read, .write = write, + .select = select, }; diff --git a/libixp_rubythread/thread_ruby.c b/libixp_rubythread/thread_ruby.c @@ -179,6 +179,7 @@ static IxpThread ixp_rthread = { .errbuf = errbuf, .read = _read, .write = _write, + .select = rb_thread_select, }; static char RWLock[] = diff --git a/libixp_task/thread_task.c b/libixp_task/thread_task.c @@ -172,5 +172,6 @@ static IxpThread ixp_task = { .errbuf = errbuf, .read = _read, .write = _write, + .select = select, /* wrong */ };