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

Comparing libeio/eio.c (file contents):
Revision 1.137 by root, Thu Jun 25 17:40:24 2015 UTC vs.
Revision 1.139 by root, Thu Jun 25 18:14:19 2015 UTC

366#define ETP_PRI_MAX EIO_PRI_MAX 366#define ETP_PRI_MAX EIO_PRI_MAX
367 367
368#define ETP_TYPE_QUIT -1 368#define ETP_TYPE_QUIT -1
369#define ETP_TYPE_GROUP EIO_GROUP 369#define ETP_TYPE_GROUP EIO_GROUP
370 370
371static void eio_nop_callback (void) { }
372static void (*eio_want_poll_cb)(void) = eio_nop_callback;
373static void (*eio_done_poll_cb)(void) = eio_nop_callback;
374
375#define ETP_WANT_POLL(pool) eio_want_poll_cb ()
376#define ETP_DONE_POLL(pool) eio_done_poll_cb ()
377
371struct etp_worker; 378struct etp_worker;
372
373#define ETP_REQ eio_req 379#define ETP_REQ eio_req
374#define ETP_DESTROY(req) eio_destroy (req) 380#define ETP_DESTROY(req) eio_destroy (req)
375static int eio_finish (eio_req *req); 381static int eio_finish (eio_req *req);
376#define ETP_FINISH(req) eio_finish (req) 382#define ETP_FINISH(req) eio_finish (req)
377static void eio_execute (struct etp_worker *self, eio_req *req); 383static void eio_execute (struct etp_worker *self, eio_req *req);
1706/*****************************************************************************/ 1712/*****************************************************************************/
1707 1713
1708#define ALLOC(len) \ 1714#define ALLOC(len) \
1709 if (!req->ptr2) \ 1715 if (!req->ptr2) \
1710 { \ 1716 { \
1711 X_LOCK (wrklock); \ 1717 X_LOCK (EIO_POOL->wrklock); \
1712 req->flags |= EIO_FLAG_PTR2_FREE; \ 1718 req->flags |= EIO_FLAG_PTR2_FREE; \
1713 X_UNLOCK (wrklock); \ 1719 X_UNLOCK (EIO_POOL->wrklock); \
1714 req->ptr2 = malloc (len); \ 1720 req->ptr2 = malloc (len); \
1715 if (!req->ptr2) \ 1721 if (!req->ptr2) \
1716 { \ 1722 { \
1717 errno = ENOMEM; \ 1723 errno = ENOMEM; \
1718 req->result = -1; \ 1724 req->result = -1; \
1723/*****************************************************************************/ 1729/*****************************************************************************/
1724 1730
1725int ecb_cold 1731int ecb_cold
1726eio_init (void (*want_poll)(void), void (*done_poll)(void)) 1732eio_init (void (*want_poll)(void), void (*done_poll)(void))
1727{ 1733{
1728 return etp_init (EIO_POOL, want_poll, done_poll); 1734 eio_want_poll_cb = want_poll;
1735 eio_done_poll_cb = done_poll;
1736
1737 return etp_init (EIO_POOL, 0, 0, 0);
1729} 1738}
1730 1739
1731ecb_inline void 1740ecb_inline void
1732eio_api_destroy (eio_req *req) 1741eio_api_destroy (eio_req *req)
1733{ 1742{

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines