ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libeio/eio.c
(Generate patch)

Comparing libeio/eio.c (file contents):
Revision 1.99 by root, Tue Jul 26 11:07:08 2011 UTC vs.
Revision 1.102 by root, Sun Aug 21 01:03:09 2011 UTC

43 43
44#include "eio.h" 44#include "eio.h"
45#include "ecb.h" 45#include "ecb.h"
46 46
47#ifdef EIO_STACKSIZE 47#ifdef EIO_STACKSIZE
48# define XTHREAD_STACKSIZE EIO_STACKSIZE 48# define X_STACKSIZE EIO_STACKSIZE
49#endif 49#endif
50#include "xthread.h" 50#include "xthread.h"
51 51
52#include <errno.h> 52#include <errno.h>
53#include <stddef.h> 53#include <stddef.h>
105#ifdef _WIN32 105#ifdef _WIN32
106 106
107 #undef PAGESIZE 107 #undef PAGESIZE
108 #define PAGESIZE 4096 /* GetSystemInfo? */ 108 #define PAGESIZE 4096 /* GetSystemInfo? */
109 109
110 /* TODO: look at how perl does stat (non-sloppy), unlink (ro-files), utime, link */
111
110 #ifdef EIO_STRUCT_STATI64 112 #ifdef EIO_STRUCT_STATI64
113 /* look at perl's non-sloppy stat */
111 #define stat(path,buf) _stati64 (path,buf) 114 #define stat(path,buf) _stati64 (path,buf)
112 #define fstat(fd,buf) _fstati64 (fd,buf) 115 #define fstat(fd,buf) _fstati64 (fd,buf)
113 #endif 116 #endif
114 #define lstat(path,buf) stat (path,buf) 117 #define lstat(path,buf) stat (path,buf)
115 #define fsync(fd) (FlushFileBuffers ((HANDLE)EIO_FD_TO_WIN32_HANDLE (fd)) ? 0 : EIO_ERRNO (EBADF, -1)) 118 #define fsync(fd) (FlushFileBuffers ((HANDLE)EIO_FD_TO_WIN32_HANDLE (fd)) ? 0 : EIO_ERRNO (EBADF, -1))
321static void (*done_poll_cb) (void); 324static void (*done_poll_cb) (void);
322 325
323static unsigned int max_poll_time; /* reslock */ 326static unsigned int max_poll_time; /* reslock */
324static unsigned int max_poll_reqs; /* reslock */ 327static unsigned int max_poll_reqs; /* reslock */
325 328
326static volatile unsigned int nreqs; /* reqlock */ 329static unsigned int nreqs; /* reqlock */
327static volatile unsigned int nready; /* reqlock */ 330static unsigned int nready; /* reqlock */
328static volatile unsigned int npending; /* reqlock */ 331static unsigned int npending; /* reqlock */
329static volatile unsigned int max_idle = 4; /* maximum number of threads that can idle indefinitely */ 332static unsigned int max_idle = 4; /* maximum number of threads that can idle indefinitely */
330static volatile unsigned int idle_timeout = 10; /* number of seconds after which an idle threads exit */ 333static unsigned int idle_timeout = 10; /* number of seconds after which an idle threads exit */
331 334
332static xmutex_t wrklock; 335static xmutex_t wrklock;
333static xmutex_t reslock; 336static xmutex_t reslock;
334static xmutex_t reqlock; 337static xmutex_t reqlock;
335static xcond_t reqwait; 338static xcond_t reqwait;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines