- fixed event queue for events >36min

This commit is contained in:
Martin Willi
2006-05-30 13:22:46 +00:00
parent 8403b34bd9
commit b93782903f
+2 -15
View File
@@ -85,7 +85,6 @@ static event_t *event_create(timeval_t time, job_t *job)
return this; return this;
} }
typedef struct private_event_queue_t private_event_queue_t; typedef struct private_event_queue_t private_event_queue_t;
/** /**
@@ -118,16 +117,7 @@ struct private_event_queue_t {
}; };
/** /**
* Returns the difference of to timeval structs in microseconds * Returns the difference of to timeval structs in milliseconds
*
* @param end_time end time
* @param start_time start time
*
* @warning this function is also defined in the tester class
* In later improvements, this function can be added to a general
* class type!
*
* @return difference in microseconds (end time - start time)
*/ */
static long time_difference(struct timeval *end_time, struct timeval *start_time) static long time_difference(struct timeval *end_time, struct timeval *start_time)
{ {
@@ -135,10 +125,9 @@ static long time_difference(struct timeval *end_time, struct timeval *start_time
seconds = (end_time->tv_sec - start_time->tv_sec); seconds = (end_time->tv_sec - start_time->tv_sec);
microseconds = (end_time->tv_usec - start_time->tv_usec); microseconds = (end_time->tv_usec - start_time->tv_usec);
return ((seconds * 1000000) + microseconds); return ((seconds * 1000) + microseconds/1000);
} }
/** /**
* Implements event_queue_t.get_count * Implements event_queue_t.get_count
*/ */
@@ -208,10 +197,8 @@ static job_t *get(private_event_queue_t *this)
next_event->destroy(next_event); next_event->destroy(next_event);
break; break;
} }
} }
pthread_cond_signal( &(this->condvar)); pthread_cond_signal( &(this->condvar));
pthread_mutex_unlock(&(this->mutex)); pthread_mutex_unlock(&(this->mutex));
return job; return job;