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

Comparing cvsroot/libeio/eio.c (file contents):
Revision 1.20 by root, Thu Jun 19 09:05:43 2008 UTC vs.
Revision 1.22 by root, Fri Jul 11 10:54:50 2008 UTC

177static mutex_t wrklock = X_MUTEX_INIT; 177static mutex_t wrklock = X_MUTEX_INIT;
178static mutex_t reslock = X_MUTEX_INIT; 178static mutex_t reslock = X_MUTEX_INIT;
179static mutex_t reqlock = X_MUTEX_INIT; 179static mutex_t reqlock = X_MUTEX_INIT;
180static cond_t reqwait = X_COND_INIT; 180static cond_t reqwait = X_COND_INIT;
181 181
182#if !HAVE_PREADWRITE
183/*
184 * make our pread/pwrite emulation safe against themselves, but not against
185 * normal read/write by using a mutex. slows down execution a lot,
186 * but that's your problem, not mine.
187 */
188static mutex_t preadwritelock = X_MUTEX_INIT;
189#endif
190
182typedef struct etp_worker 191typedef struct etp_worker
183{ 192{
184 /* locked by wrklock */ 193 /* locked by wrklock */
185 struct etp_worker *prev, *next; 194 struct etp_worker *prev, *next;
186 195
330 339
331static void etp_atfork_child (void) 340static void etp_atfork_child (void)
332{ 341{
333 ETP_REQ *prv; 342 ETP_REQ *prv;
334 343
335 while (prv = reqq_shift (&req_queue)) 344 while ((prv = reqq_shift (&req_queue)))
336 ETP_DESTROY (prv); 345 ETP_DESTROY (prv);
337 346
338 while (prv = reqq_shift (&res_queue)) 347 while ((prv = reqq_shift (&res_queue)))
339 ETP_DESTROY (prv); 348 ETP_DESTROY (prv);
340 349
341 while (wrk_first.next != &wrk_first) 350 while (wrk_first.next != &wrk_first)
342 { 351 {
343 etp_worker *wrk = wrk_first.next; 352 etp_worker *wrk = wrk_first.next;
699/* work around various missing functions */ 708/* work around various missing functions */
700 709
701#if !HAVE_PREADWRITE 710#if !HAVE_PREADWRITE
702# define pread eio__pread 711# define pread eio__pread
703# define pwrite eio__pwrite 712# define pwrite eio__pwrite
704
705/*
706 * make our pread/pwrite safe against themselves, but not against
707 * normal read/write by using a mutex. slows down execution a lot,
708 * but that's your problem, not mine.
709 */
710static mutex_t preadwritelock = X_MUTEX_INIT;
711 713
712static ssize_t 714static ssize_t
713eio__pread (int fd, void *buf, size_t count, off_t offset) 715eio__pread (int fd, void *buf, size_t count, off_t offset)
714{ 716{
715 ssize_t res; 717 ssize_t res;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines