Changeset 074bdaa for perlconfig.c


Ignore:
Timestamp:
Jun 22, 2011, 12:37:21 AM (13 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.10, release-1.8, release-1.9
Children:
bcde7926
Parents:
58f4fb2
git-author:
David Benjamin <davidben@mit.edu> (05/24/11 00:36:51)
git-committer:
David Benjamin <davidben@mit.edu> (06/22/11 00:37:21)
Message:
Replace BarnOwl::Timer with a perl wrapper over AnyEvent

This also allows us to kill owl_timer altogether.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perlconfig.c

    r937a00e9 r074bdaa  
    612612  LEAVE;
    613613}
    614 
    615 void owl_perlconfig_perl_timer(owl_timer *t, void *data)
    616 {
    617   dSP;
    618   SV *obj = data;
    619 
    620   if(!SvROK(obj)) {
    621     return;
    622   }
    623 
    624   ENTER;
    625   SAVETMPS;
    626 
    627   PUSHMARK(SP);
    628   XPUSHs(obj);
    629   PUTBACK;
    630 
    631   call_method("do_callback", G_DISCARD|G_EVAL);
    632 
    633   SPAGAIN;
    634 
    635   if (SvTRUE(ERRSV)) {
    636     owl_function_error("Error in callback: '%s'", SvPV_nolen(ERRSV));
    637     sv_setsv (ERRSV, &PL_sv_undef);
    638   }
    639 
    640   PUTBACK;
    641   FREETMPS;
    642   LEAVE;
    643 }
    644 
    645 void owl_perlconfig_perl_timer_destroy(owl_timer *t)
    646 {
    647   if(SvOK((SV*)t->data)) {
    648     SvREFCNT_dec((SV*)t->data);
    649   }
    650 }
Note: See TracChangeset for help on using the changeset viewer.