Hopefully fix the remaining issue in the High Resolution Timing support

code and re-enable it on Linux platforms (they have clock_nanosleep). Why
did I trigger an interrupt inside a held lock? Hmmm, we should probably
add an _ack semaphore like we do e.g. for ethernet.
This commit is contained in:
gbeauche 2005-07-01 23:15:11 +00:00
parent 245c691102
commit 2881c20813
2 changed files with 3 additions and 3 deletions

View File

@ -419,7 +419,7 @@ typedef struct timeval tm_time_t;
#define C4X_FLOAT_FORMAT 4
// High-precision timing
#if defined(HAVE_PTHREADS) && defined(HAVE_CLOCK_NANOSLEEP) && 0
#if defined(HAVE_PTHREADS) && defined(HAVE_CLOCK_NANOSLEEP)
#define PRECISE_TIMING 1
#define PRECISE_TIMING_POSIX 1
#endif

View File

@ -532,15 +532,15 @@ static void *timer_func(void *arg)
tm_time_t system_time;
timer_current_time(system_time);
pthread_mutex_lock(&wakeup_time_lock);
if (timer_cmp_time(wakeup_time, system_time) < 0) {
// Timer expired, trigger interrupt
pthread_mutex_lock(&wakeup_time_lock);
wakeup_time = wakeup_time_max;
pthread_mutex_unlock(&wakeup_time_lock);
SetInterruptFlag(INTFLAG_TIMER);
TriggerInterrupt();
}
pthread_mutex_unlock(&wakeup_time_lock);
}
return NULL;
}