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

Comparing BDB/BDB.xs (file contents):
Revision 1.36 by root, Sun Mar 30 08:01:58 2008 UTC vs.
Revision 1.37 by root, Sat May 10 20:23:06 2008 UTC

181 NUM_PRI = PRI_MAX + PRI_BIAS + 1, 181 NUM_PRI = PRI_MAX + PRI_BIAS + 1,
182}; 182};
183 183
184#define AIO_TICKS ((1000000 + 1023) >> 10) 184#define AIO_TICKS ((1000000 + 1023) >> 10)
185 185
186static SV *on_next_submit;
187
186static unsigned int max_poll_time = 0; 188static unsigned int max_poll_time = 0;
187static unsigned int max_poll_reqs = 0; 189static unsigned int max_poll_reqs = 0;
188 190
189/* calculcate time difference in ~1/AIO_TICKS of a second */ 191/* calculcate time difference in ~1/AIO_TICKS of a second */
190static int tvdiff (struct timeval *tv1, struct timeval *tv2) 192static int tvdiff (struct timeval *tv1, struct timeval *tv2)
500} 502}
501 503
502static void req_send (bdb_req req) 504static void req_send (bdb_req req)
503{ 505{
504 SV *wait_callback = 0; 506 SV *wait_callback = 0;
507
508 if (on_next_submit)
509 {
510 dSP;
511 SV *cb = sv_2mortal (on_next_submit);
512
513 on_next_submit = 0;
514
515 PUSHMARK (SP);
516 PUTBACK;
517 call_sv (cb, G_DISCARD | G_EVAL);
518 }
505 519
506 // synthesize callback if none given 520 // synthesize callback if none given
507 if (!SvOK (req->callback)) 521 if (!SvOK (req->callback))
508 { 522 {
509 int count; 523 int count;
1378 CODE: 1392 CODE:
1379 RETVAL = db_strerror (errorno); 1393 RETVAL = db_strerror (errorno);
1380 OUTPUT: 1394 OUTPUT:
1381 RETVAL 1395 RETVAL
1382 1396
1397void _on_next_submit (SV *cb)
1398 CODE:
1399 SvREFCNT_dec (on_next_submit);
1400 on_next_submit = SvOK (cb) ? newSVsv (cb) : 0;
1401
1383DB_ENV * 1402DB_ENV *
1384db_env_create (U32 env_flags = 0) 1403db_env_create (U32 env_flags = 0)
1385 CODE: 1404 CODE:
1386{ 1405{
1387 errno = db_env_create (&RETVAL, env_flags); 1406 errno = db_env_create (&RETVAL, env_flags);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines