mirror of https://github.com/mpv-player/mpv
threads: fix function name
Closer to the corresponding standard function pthread_cond_timedwait.
This commit is contained in:
parent
80ff94131b
commit
cd10af4db6
|
@ -198,7 +198,7 @@ void mp_dispatch_queue_process(struct mp_dispatch_queue *queue, double timeout)
|
|||
}
|
||||
} else {
|
||||
if (timeout > 0) {
|
||||
mpthread_cond_timed_wait(&queue->cond, &queue->lock, timeout);
|
||||
mpthread_cond_timedwait(&queue->cond, &queue->lock, timeout);
|
||||
} else {
|
||||
pthread_cond_wait(&queue->cond, &queue->lock);
|
||||
}
|
||||
|
|
|
@ -62,8 +62,8 @@ struct timespec mpthread_get_deadline(double timeout)
|
|||
}
|
||||
|
||||
// Call pthread_cond_timedwait() with a relative timeout in seconds
|
||||
int mpthread_cond_timed_wait(pthread_cond_t *cond, pthread_mutex_t *mutex,
|
||||
double timeout)
|
||||
int mpthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
|
||||
double timeout)
|
||||
{
|
||||
struct timespec ts = mpthread_get_deadline(timeout);
|
||||
return pthread_cond_timedwait(cond, mutex, &ts);
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
|
||||
struct timespec mpthread_get_deadline(double timeout);
|
||||
|
||||
int mpthread_cond_timed_wait(pthread_cond_t *cond, pthread_mutex_t *mutex,
|
||||
double timeout);
|
||||
int mpthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
|
||||
double timeout);
|
||||
|
||||
int mpthread_mutex_init_recursive(pthread_mutex_t *mutex);
|
||||
|
||||
|
|
|
@ -167,7 +167,7 @@ static int cache_wakeup_and_wait(struct priv *s, double *retry_time)
|
|||
}
|
||||
|
||||
pthread_cond_signal(&s->wakeup);
|
||||
mpthread_cond_timed_wait(&s->wakeup, &s->mutex, CACHE_WAIT_TIME);
|
||||
mpthread_cond_timedwait(&s->wakeup, &s->mutex, CACHE_WAIT_TIME);
|
||||
|
||||
*retry_time += mp_time_sec() - start;
|
||||
|
||||
|
@ -529,7 +529,7 @@ static void *cache_thread(void *arg)
|
|||
s->control = CACHE_CTRL_NONE;
|
||||
}
|
||||
if (s->idle && s->control == CACHE_CTRL_NONE)
|
||||
mpthread_cond_timed_wait(&s->wakeup, &s->mutex, CACHE_IDLE_SLEEP_TIME);
|
||||
mpthread_cond_timedwait(&s->wakeup, &s->mutex, CACHE_IDLE_SLEEP_TIME);
|
||||
}
|
||||
pthread_cond_signal(&s->wakeup);
|
||||
pthread_mutex_unlock(&s->mutex);
|
||||
|
|
Loading…
Reference in New Issue