diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2010-05-23 16:57:20 -0700 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2010-05-23 17:02:35 -0700 |
commit | 0f143f6c23da9be0d88698f418c175dd5424f0b1 (patch) | |
tree | 109319d7392d7ccfa480a8175d3cf5dff22bafa8 /deps/libeio | |
parent | b58db3cd737fffb9ab326b8dc5191fde56a7a0d3 (diff) | |
download | node-new-0f143f6c23da9be0d88698f418c175dd5424f0b1.tar.gz |
Upgrade libeio
Diffstat (limited to 'deps/libeio')
-rw-r--r-- | deps/libeio/demo.c | 4 | ||||
-rw-r--r-- | deps/libeio/eio.c | 13 | ||||
-rw-r--r-- | deps/libeio/xthread.h | 16 |
3 files changed, 17 insertions, 16 deletions
diff --git a/deps/libeio/demo.c b/deps/libeio/demo.c index 439ae7f91b..a865bcced3 100644 --- a/deps/libeio/demo.c +++ b/deps/libeio/demo.c @@ -144,8 +144,8 @@ main (void) eio_chown ("eio-test-dir", getuid (), getgid (), 0, res_cb, "chown"); eio_fchown (last_fd, getuid (), getgid (), 0, res_cb, "fchown"); eio_fchmod (last_fd, 0123, 0, res_cb, "fchmod"); - eio_readdir ("eio-test-dir", 0, readdir_cb, "readdir"); - eio_readdir ("/nonexistant", 0, readdir_cb, "readdir"); + eio_readdir ("eio-test-dir", 0, 0, readdir_cb, "readdir"); + eio_readdir ("/nonexistant", 0, 0, readdir_cb, "readdir"); eio_fstat (last_fd, 0, stat_cb, "stat"); eio_write (last_fd, "test\nfail\n", 10, 4, 0, res_cb, "write"); event_loop (); diff --git a/deps/libeio/eio.c b/deps/libeio/eio.c index 937c066a84..6f61f5da80 100644 --- a/deps/libeio/eio.c +++ b/deps/libeio/eio.c @@ -55,6 +55,7 @@ #include <limits.h> #include <fcntl.h> #include <assert.h> +#include <stdint.h> #ifndef EIO_FINISH # define EIO_FINISH(req) ((req)->finish) && !EIO_CANCELLED (req) ? (req)->finish (req) : 0 @@ -224,10 +225,10 @@ static volatile unsigned int nready; /* reqlock */ static volatile unsigned int npending; /* reqlock */ static volatile unsigned int max_idle = 4; -static mutex_t wrklock = X_MUTEX_INIT; -static mutex_t reslock = X_MUTEX_INIT; -static mutex_t reqlock = X_MUTEX_INIT; -static cond_t reqwait = X_COND_INIT; +static xmutex_t wrklock = X_MUTEX_INIT; +static xmutex_t reslock = X_MUTEX_INIT; +static xmutex_t reqlock = X_MUTEX_INIT; +static xcond_t reqwait = X_COND_INIT; #if !HAVE_PREADWRITE /* @@ -235,7 +236,7 @@ static cond_t reqwait = X_COND_INIT; * normal read/write by using a mutex. slows down execution a lot, * but that's your problem, not mine. */ -static mutex_t preadwritelock = X_MUTEX_INIT; +static xmutex_t preadwritelock = X_MUTEX_INIT; #endif typedef struct etp_worker @@ -243,7 +244,7 @@ typedef struct etp_worker /* locked by wrklock */ struct etp_worker *prev, *next; - thread_t tid; + xthread_t tid; /* locked by reslock, reqlock or wrklock */ ETP_REQ *req; /* currently processed request */ diff --git a/deps/libeio/xthread.h b/deps/libeio/xthread.h index d9a404e5e7..9cd2b6e51c 100644 --- a/deps/libeio/xthread.h +++ b/deps/libeio/xthread.h @@ -35,23 +35,23 @@ typedef int ssize_t; #define sigemptyset(s) #define sigfillset(s) -typedef pthread_mutex_t mutex_t; +typedef pthread_mutex_t xmutex_t; #define X_MUTEX_INIT PTHREAD_MUTEX_INITIALIZER #define X_LOCK(mutex) pthread_mutex_lock (&(mutex)) #define X_UNLOCK(mutex) pthread_mutex_unlock (&(mutex)) -typedef pthread_cond_t cond_t; +typedef pthread_cond_t xcond_t; #define X_COND_INIT PTHREAD_COND_INITIALIZER #define X_COND_SIGNAL(cond) pthread_cond_signal (&(cond)) #define X_COND_WAIT(cond,mutex) pthread_cond_wait (&(cond), &(mutex)) #define X_COND_TIMEDWAIT(cond,mutex,to) pthread_cond_timedwait (&(cond), &(mutex), &(to)) -typedef pthread_t thread_t; +typedef pthread_t xthread_t; #define X_THREAD_PROC(name) void *name (void *thr_arg) #define X_THREAD_ATFORK(a,b,c) static int -thread_create (thread_t *tid, void *(*proc)(void *), void *arg) +thread_create (xthread_t *tid, void *(*proc)(void *), void *arg) { int retval; pthread_attr_t attr; @@ -94,7 +94,7 @@ thread_create (thread_t *tid, void *(*proc)(void *), void *arg) #include <limits.h> #include <pthread.h> -typedef pthread_mutex_t mutex_t; +typedef pthread_mutex_t xmutex_t; #if __linux && defined (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP) # define X_MUTEX_INIT PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP #else @@ -103,13 +103,13 @@ typedef pthread_mutex_t mutex_t; #define X_LOCK(mutex) pthread_mutex_lock (&(mutex)) #define X_UNLOCK(mutex) pthread_mutex_unlock (&(mutex)) -typedef pthread_cond_t cond_t; +typedef pthread_cond_t xcond_t; #define X_COND_INIT PTHREAD_COND_INITIALIZER #define X_COND_SIGNAL(cond) pthread_cond_signal (&(cond)) #define X_COND_WAIT(cond,mutex) pthread_cond_wait (&(cond), &(mutex)) #define X_COND_TIMEDWAIT(cond,mutex,to) pthread_cond_timedwait (&(cond), &(mutex), &(to)) -typedef pthread_t thread_t; +typedef pthread_t xthread_t; #define X_THREAD_PROC(name) static void *name (void *thr_arg) #define X_THREAD_ATFORK(prepare,parent,child) pthread_atfork (prepare, parent, child) @@ -123,7 +123,7 @@ typedef pthread_t thread_t; #endif static int -thread_create (thread_t *tid, void *(*proc)(void *), void *arg) +thread_create (xthread_t *tid, void *(*proc)(void *), void *arg) { int retval; sigset_t fullsigset, oldsigset; |