… | |
… | |
177 | static mutex_t wrklock = X_MUTEX_INIT; |
177 | static mutex_t wrklock = X_MUTEX_INIT; |
178 | static mutex_t reslock = X_MUTEX_INIT; |
178 | static mutex_t reslock = X_MUTEX_INIT; |
179 | static mutex_t reqlock = X_MUTEX_INIT; |
179 | static mutex_t reqlock = X_MUTEX_INIT; |
180 | static cond_t reqwait = X_COND_INIT; |
180 | static 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 | */ |
|
|
188 | static mutex_t preadwritelock = X_MUTEX_INIT; |
|
|
189 | #endif |
|
|
190 | |
182 | typedef struct etp_worker |
191 | typedef 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 | |
… | |
… | |
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 | */ |
|
|
710 | static mutex_t preadwritelock = X_MUTEX_INIT; |
|
|
711 | |
713 | |
712 | static ssize_t |
714 | static ssize_t |
713 | eio__pread (int fd, void *buf, size_t count, off_t offset) |
715 | eio__pread (int fd, void *buf, size_t count, off_t offset) |
714 | { |
716 | { |
715 | ssize_t res; |
717 | ssize_t res; |