Changeset 3ecd78b


Ignore:
Timestamp:
Sep 18, 2010, 3:14:30 PM (10 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.7, release-1.8, release-1.9
Children:
de6f317
Parents:
8402a093
git-author:
David Benjamin <davidben@mit.edu> (09/14/10 16:52:41)
git-committer:
David Benjamin <davidben@mit.edu> (09/18/10 15:14:30)
Message:
Move the event loop to owl_select as owl_select_run_loop

Also adds a function to quit the select loop so that owl_function_quit
needn't exit() directly. main should be allowed to clean up after
itself.
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    r0743696 r3ecd78b  
    976976
    977977  owl_function_debugmsg("Quitting Owl");
    978   exit(0);
     978  owl_select_quit_loop();
    979979}
    980980
  • owl.c

    r8402a093 r3ecd78b  
    584584
    585585  owl_function_debugmsg("startup: entering main loop");
    586   /* main loop */
    587   while (1) {
    588     /* select on FDs we know about. */
    589     owl_select();
    590   }
    591 }
     586  owl_select_run_loop();
     587  return 0;
     588}
  • select.c

    rc3031f3 r3ecd78b  
    33static int dispatch_active = 0;
    44static int psa_active = 0;
     5static int loop_active = 0;
    56
    67int _owl_select_timer_cmp(const owl_timer *t1, const owl_timer *t2) {
     
    436437  }
    437438}
     439
     440void owl_select_run_loop(void)
     441{
     442  loop_active = 1;
     443  while (loop_active) {
     444    owl_select();
     445  }
     446}
     447
     448void owl_select_quit_loop(void)
     449{
     450  loop_active = 0;
     451}
Note: See TracChangeset for help on using the changeset viewer.