ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/IO-AIO/AIO.xs
(Generate patch)

Comparing IO-AIO/AIO.xs (file contents):
Revision 1.120 by root, Sun May 11 19:17:09 2008 UTC vs.
Revision 1.121 by root, Tue May 13 18:50:27 2008 UTC

80typedef SV SV8; /* byte-sv, used for argument-checking */ 80typedef SV SV8; /* byte-sv, used for argument-checking */
81 81
82#define AIO_REQ_KLASS "IO::AIO::REQ" 82#define AIO_REQ_KLASS "IO::AIO::REQ"
83#define AIO_GRP_KLASS "IO::AIO::GRP" 83#define AIO_GRP_KLASS "IO::AIO::GRP"
84 84
85#define EIO_COMMON \ 85#define EIO_REQ_MEMBERS \
86 SV *callback; \ 86 SV *callback; \
87 SV *sv1, *sv2; \ 87 SV *sv1, *sv2; \
88 STRLEN stroffset; \ 88 STRLEN stroffset; \
89 SV *self 89 SV *self;
90 90
91#include "libeio/eio.h" 91#include "libeio/eio.h"
92 92
93static int req_invoke (eio_req *req); 93static int req_invoke (eio_req *req);
94#define EIO_FINISH(req) req_invoke (req) 94#define EIO_FINISH(req) req_invoke (req)
105 105
106typedef eio_req *aio_req; 106typedef eio_req *aio_req;
107typedef eio_req *aio_req_ornot; 107typedef eio_req *aio_req_ornot;
108 108
109static SV *on_next_submit; 109static SV *on_next_submit;
110static int next_pri = EIO_DEFAULT_PRI + EIO_PRI_BIAS; 110static int next_pri = EIO_PRI_DEFAULT;
111static int max_outstanding; 111static int max_outstanding;
112 112
113static int respipe_osf [2], respipe [2] = { -1, -1 }; 113static int respipe_osf [2], respipe [2] = { -1, -1 };
114 114
115static void req_destroy (aio_req req); 115static void req_destroy (aio_req req);
443} 443}
444 444
445#define dREQ \ 445#define dREQ \
446 aio_req req; \ 446 aio_req req; \
447 int req_pri = next_pri; \ 447 int req_pri = next_pri; \
448 next_pri = EIO_DEFAULT_PRI + EIO_PRI_BIAS; \ 448 next_pri = EIO_PRI_DEFAULT; \
449 \ 449 \
450 if (SvOK (callback) && !SvROK (callback)) \ 450 if (SvOK (callback) && !SvROK (callback)) \
451 croak ("callback must be undef or of reference type"); \ 451 croak ("callback must be undef or of reference type"); \
452 \ 452 \
453 Newz (0, req, 1, eio_req); \ 453 Newz (0, req, 1, eio_req); \
917 917
918int 918int
919aioreq_pri (int pri = 0) 919aioreq_pri (int pri = 0)
920 PROTOTYPE: ;$ 920 PROTOTYPE: ;$
921 CODE: 921 CODE:
922 RETVAL = next_pri - EIO_PRI_BIAS; 922 RETVAL = next_pri;
923 if (items > 0) 923 if (items > 0)
924 { 924 {
925 if (pri < EIO_PRI_MIN) pri = EIO_PRI_MIN; 925 if (pri < EIO_PRI_MIN) pri = EIO_PRI_MIN;
926 if (pri > EIO_PRI_MAX) pri = EIO_PRI_MAX; 926 if (pri > EIO_PRI_MAX) pri = EIO_PRI_MAX;
927 next_pri = pri + EIO_PRI_BIAS; 927 next_pri = pri;
928 } 928 }
929 OUTPUT: 929 OUTPUT:
930 RETVAL 930 RETVAL
931 931
932void 932void
933aioreq_nice (int nice = 0) 933aioreq_nice (int nice = 0)
934 CODE: 934 CODE:
935 nice = next_pri - nice; 935 nice = next_pri - nice;
936 if (nice < EIO_PRI_MIN) nice = EIO_PRI_MIN; 936 if (nice < EIO_PRI_MIN) nice = EIO_PRI_MIN;
937 if (nice > EIO_PRI_MAX) nice = EIO_PRI_MAX; 937 if (nice > EIO_PRI_MAX) nice = EIO_PRI_MAX;
938 next_pri = nice + EIO_PRI_BIAS; 938 next_pri = nice;
939 939
940void 940void
941flush () 941flush ()
942 PROTOTYPE: 942 PROTOTYPE:
943 CODE: 943 CODE:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines