Main Page | Data Structures | File List | Data Fields | Globals

scheduler.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define TIMER_PERIOD_COUNTS   50000

Functions

int scheduler (command_options_t *options)


Define Documentation

#define TIMER_PERIOD_COUNTS   50000
 

Definition at line 47 of file scheduler.h.


Function Documentation

int scheduler command_options_t options  ) 
 

Definition at line 54 of file scheduler.c.

References command_options_t, options, periodic_thread(), socket_comm(), timer_struct::timeout, timer_struct::timer_period, and timer_struct_t.

Referenced by main().

00054                                            {
00055   enum {INIT,WAIT,EXECUTE};
00056   static int sch_state=INIT;
00057   static timer_struct_t ts; 
00058   static pthread_t thread;
00059   int ret_val=0;
00060 
00061   switch (sch_state) {
00062   case INIT:
00063     ts.timer_period=TIMER_PERIOD_COUNTS;
00064     ts.timeout=0;
00065     pthread_create(&thread,NULL,periodic_thread,&ts);
00066     sch_state=WAIT;
00067     break;
00068   case WAIT:
00069     if (ts.timeout) {
00070       ts.timeout=0;
00071       sch_state=EXECUTE;
00072     }
00073     break;
00074   case EXECUTE:
00075     socket_comm(options);
00076     sch_state=WAIT;
00077     break;
00078   }
00079   return (ret_val);
00080 }

Here is the call graph for this function:


Generated on Fri Nov 3 15:24:55 2006 for ERT1 Communication Server by  doxygen 1.3.9.1