mirror of
https://github.com/kanjitalk755/macemu.git
synced 2024-11-18 18:05:21 +00:00
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:
parent
245c691102
commit
2881c20813
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user