Changeset 3aa0522


Ignore:
Timestamp:
May 19, 2010, 9:58:09 PM (15 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.10, release-1.7, release-1.8, release-1.9
Children:
7c5d060
Parents:
8278543
git-author:
David Benjamin <davidben@mit.edu> (05/14/10 19:15:32)
git-committer:
David Benjamin <davidben@mit.edu> (05/19/10 21:58:09)
Message:
Deprecate the main loop hook, use on-demand perl timer

Users without a main loop hook shouldn't need to pay 1s wakeups, and
users with one probably want more control over the timeout anyway.

Signed-off-by: David Benjamin <davidben@mit.edu>
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • owl.c

    r3687413 r3aa0522  
    619619  owl_global_push_context(&g, OWL_CTX_READCONFIG|OWL_CTX_RECV, NULL, "recv");
    620620
    621   /* If we ever deprecate the mainloop hook, remove this. */
    622   owl_select_add_timer(0, 1, owl_perlconfig_mainloop, NULL, NULL);
    623 
    624621  owl_select_add_pre_select_action(owl_refresh_pre_select_action, NULL, NULL);
    625622  owl_select_add_pre_select_action(owl_process_messages, NULL, NULL);
  • perl/lib/BarnOwl/Hooks.pm

    rb30c256 r3aa0522  
    7979our %EXPORT_TAGS = (all => [@EXPORT_OK]);
    8080
     81use BarnOwl::MainLoopCompatHook;
     82
    8183our $startup = BarnOwl::Hook->new;
    8284our $shutdown = BarnOwl::Hook->new;
    8385our $receiveMessage = BarnOwl::Hook->new;
    8486our $newMessage = BarnOwl::Hook->new;
    85 our $mainLoop = BarnOwl::Hook->new;
     87our $mainLoop = BarnOwl::MainLoopCompatHook->new;
    8688our $getBuddyList = BarnOwl::Hook->new;
    8789our $getQuickstart = BarnOwl::Hook->new;
     
    162164    }
    163165   
     166    $mainLoop->check_owlconf();
    164167    $startup->run(0);
    165168    BarnOwl::startup() if *BarnOwl::startup{CODE};
     
    186189   
    187190    BarnOwl::new_msg($m) if *BarnOwl::new_msg{CODE};
    188 }
    189 
    190 sub _mainloop_hook {
    191     $mainLoop->run;
    192     BarnOwl::mainloop_hook() if *BarnOwl::mainloop_hook{CODE};
    193191}
    194192
  • perlconfig.c

    r1b1cd2c r3aa0522  
    582582}
    583583
    584 void owl_perlconfig_mainloop(owl_timer *t, void *data)
    585 {
    586   dSP;
    587   if (!owl_perlconfig_is_function("BarnOwl::Hooks::_mainloop_hook"))
    588     return;
    589   PUSHMARK(SP) ;
    590   call_pv("BarnOwl::Hooks::_mainloop_hook", G_DISCARD|G_EVAL);
    591   if(SvTRUE(ERRSV)) {
    592     owl_function_error("%s", SvPV_nolen(ERRSV));
    593   }
    594   return;
    595 }
    596 
    597584void owl_perlconfig_io_dispatch(const owl_io_dispatch *d, void *data)
    598585{
Note: See TracChangeset for help on using the changeset viewer.