… | |
… | |
8 | #include <errno.h> |
8 | #include <errno.h> |
9 | #include <sys/types.h> |
9 | #include <sys/types.h> |
10 | #include <sys/stat.h> |
10 | #include <sys/stat.h> |
11 | #include <limits.h> |
11 | #include <limits.h> |
12 | #include <fcntl.h> |
12 | #include <fcntl.h> |
13 | #include <sched.h> |
13 | #include <assert.h> |
14 | |
14 | |
15 | #ifndef EIO_FINISH |
15 | #ifndef EIO_FINISH |
16 | # define EIO_FINISH(req) ((req)->finish) && !EIO_CANCELLED (req) ? (req)->finish (req) : 0 |
16 | # define EIO_FINISH(req) ((req)->finish) && !EIO_CANCELLED (req) ? (req)->finish (req) : 0 |
17 | #endif |
17 | #endif |
18 | |
18 | |
… | |
… | |
325 | |
325 | |
326 | static void start_thread (void) |
326 | static void start_thread (void) |
327 | { |
327 | { |
328 | worker *wrk = calloc (1, sizeof (worker)); |
328 | worker *wrk = calloc (1, sizeof (worker)); |
329 | |
329 | |
330 | if (!wrk) |
330 | /*TODO*/ |
331 | croak ("unable to allocate worker thread data"); |
331 | assert (("unable to allocate worker thread data", !wrk)); |
332 | |
332 | |
333 | X_LOCK (wrklock); |
333 | X_LOCK (wrklock); |
334 | |
334 | |
335 | if (thread_create (&wrk->tid, eio_proc, (void *)wrk)) |
335 | if (thread_create (&wrk->tid, eio_proc, (void *)wrk)) |
336 | { |
336 | { |