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.60 by root, Mon Oct 23 20:05:27 2006 UTC vs.
Revision 1.62 by root, Mon Oct 23 22:45:18 2006 UTC

95 95
96typedef aio_cb *aio_req; 96typedef aio_cb *aio_req;
97typedef aio_cb *aio_req_ornot; 97typedef aio_cb *aio_req_ornot;
98 98
99enum { 99enum {
100 PRI_MIN = 4, 100 PRI_MIN = -4,
101 PRI_MAX = -4, 101 PRI_MAX = 4,
102 102
103 DEFAULT_PRI = 0, 103 DEFAULT_PRI = 0,
104 PRI_BIAS = PRI_MIN, 104 PRI_BIAS = -PRI_MIN,
105}; 105};
106 106
107static int next_pri = DEFAULT_PRI + PRI_BIAS; 107static int next_pri = DEFAULT_PRI + PRI_BIAS;
108 108
109static int started, wanted; 109static int started, wanted;
191 } 191 }
192} 192}
193 193
194static void poll_wait () 194static void poll_wait ()
195{ 195{
196 fd_set rfd;
197
196 while (nreqs) 198 while (nreqs)
197 { 199 {
198 aio_req req; 200 aio_req req;
199 pthread_mutex_lock (&reslock); 201 pthread_mutex_lock (&reslock);
200 req = ress; 202 req = ress;
201 pthread_mutex_unlock (&reslock); 203 pthread_mutex_unlock (&reslock);
202 204
203 if (req) 205 if (req)
204 return; 206 return;
205 207
206 fd_set rfd;
207 FD_ZERO(&rfd); 208 FD_ZERO(&rfd);
208 FD_SET(respipe [0], &rfd); 209 FD_SET(respipe [0], &rfd);
209 210
210 select (respipe [0] + 1, &rfd, 0, 0, 0); 211 select (respipe [0] + 1, &rfd, 0, 0, 0);
211 } 212 }
1260#if 0 1261#if 0
1261 1262
1262void 1263void
1263aio_pri (int pri = DEFAULT_PRI) 1264aio_pri (int pri = DEFAULT_PRI)
1264 CODE: 1265 CODE:
1265 if (pri > PRI_MIN) pri = PRI_MIN; 1266 if (pri < PRI_MIN) pri = PRI_MIN;
1266 if (pri < PRI_MAX) pri = PRI_MAX; 1267 if (pri > PRI_MAX) pri = PRI_MAX;
1267 next_pri = pri + PRI_BIAS; 1268 next_pri = pri + PRI_BIAS;
1268 1269
1269#endif 1270#endif
1270 1271
1271void 1272void

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines