[Aggregator] Launch monitor aps thread

This commit is contained in:
Matteo Cypriani 2010-10-26 10:24:29 +02:00
parent 05ceea9950
commit bdecd07125
1 changed files with 7 additions and 0 deletions

View File

@ -23,6 +23,7 @@ int main(int argc, char **argv)
struct sigaction action ; // Signal handler structure struct sigaction action ; // Signal handler structure
pthread_t pthread_t
monitor_thread, // Aggregated data monitoring thread monitor_thread, // Aggregated data monitoring thread
monitor_aps_thread, // APs monitoring thread
autocalibration_hello_thread ; // Hello messages reception thread autocalibration_hello_thread ; // Hello messages reception thread
unsigned int listening_port ; unsigned int listening_port ;
int sockfd ; // UDP listening socket int sockfd ; // UDP listening socket
@ -51,6 +52,8 @@ int main(int argc, char **argv)
(void *) &monitor_couples, NULL) ; (void *) &monitor_couples, NULL) ;
pthread_create(&autocalibration_hello_thread, NULL, pthread_create(&autocalibration_hello_thread, NULL,
(void *) &listen_for_aps, NULL) ; (void *) &listen_for_aps, NULL) ;
pthread_create(&monitor_aps_thread, NULL,
(void *) &monitor_aps, NULL) ;
run = TRUE ; run = TRUE ;
ret = read_loop(sockfd) ; ret = read_loop(sockfd) ;
@ -798,6 +801,10 @@ void push_ap(ap_list *ap)
*/ */
void monitor_aps() void monitor_aps()
{ {
#ifdef DEBUG
fprintf(stderr, "Monitor AP thread launched.\n") ;
#endif // DEBUG
while (run) while (run)
{ {
delete_old_aps() ; delete_old_aps() ;