… | |
… | |
224 | static int next_pri = DEFAULT_PRI + PRI_BIAS; |
224 | static int next_pri = DEFAULT_PRI + PRI_BIAS; |
225 | |
225 | |
226 | static unsigned int started, idle, wanted; |
226 | static unsigned int started, idle, wanted; |
227 | |
227 | |
228 | /* worker threads management */ |
228 | /* worker threads management */ |
229 | static mutex_t wrklock = X_MUTEX_INIT; |
229 | static xmutex_t wrklock = X_MUTEX_INIT; |
230 | |
230 | |
231 | typedef struct worker { |
231 | typedef struct worker { |
232 | /* locked by wrklock */ |
232 | /* locked by wrklock */ |
233 | struct worker *prev, *next; |
233 | struct worker *prev, *next; |
234 | |
234 | |
235 | thread_t tid; |
235 | xthread_t tid; |
236 | |
236 | |
237 | /* locked by reslock, reqlock or wrklock */ |
237 | /* locked by reslock, reqlock or wrklock */ |
238 | bdb_req req; /* currently processed request */ |
238 | bdb_req req; /* currently processed request */ |
239 | void *dbuf; |
239 | void *dbuf; |
240 | DIR *dirp; |
240 | DIR *dirp; |
… | |
… | |
257 | static volatile unsigned int nreqs, nready, npending; |
257 | static volatile unsigned int nreqs, nready, npending; |
258 | static volatile unsigned int max_idle = 4; |
258 | static volatile unsigned int max_idle = 4; |
259 | static volatile unsigned int max_outstanding = 0xffffffff; |
259 | static volatile unsigned int max_outstanding = 0xffffffff; |
260 | static s_epipe respipe; |
260 | static s_epipe respipe; |
261 | |
261 | |
262 | static mutex_t reslock = X_MUTEX_INIT; |
262 | static xmutex_t reslock = X_MUTEX_INIT; |
263 | static mutex_t reqlock = X_MUTEX_INIT; |
263 | static xmutex_t reqlock = X_MUTEX_INIT; |
264 | static cond_t reqwait = X_COND_INIT; |
264 | static xcond_t reqwait = X_COND_INIT; |
265 | |
265 | |
266 | #if WORDACCESS_UNSAFE |
266 | #if WORDACCESS_UNSAFE |
267 | |
267 | |
268 | static unsigned int get_nready (void) |
268 | static unsigned int get_nready (void) |
269 | { |
269 | { |