mirror of
https://github.com/linux-speakup/espeakup.git
synced 2026-08-09 09:19:09 +02:00
fixup! espeak: back off before retrying after any espeak error
This commit is contained in:
parent
6835449642
commit
76a2af5008
2 changed files with 4 additions and 3 deletions
|
|
@ -375,7 +375,7 @@ static void espeak_wait_retry(void)
|
|||
{
|
||||
struct timespec timeout;
|
||||
|
||||
clock_gettime(CLOCK_REALTIME, &timeout);
|
||||
clock_gettime(CLOCK_MONOTONIC, &timeout);
|
||||
timeout.tv_sec++;
|
||||
pthread_cond_timedwait(&wake_stop, &queue_guard, &timeout);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,8 +41,8 @@ volatile int should_run = 1;
|
|||
espeak_AUDIO_OUTPUT audio_mode;
|
||||
|
||||
pthread_cond_t runner_awake = PTHREAD_COND_INITIALIZER;
|
||||
pthread_cond_t wake_stop = PTHREAD_COND_INITIALIZER;
|
||||
/* Initialized in main: uses the monotonic clock for timed waits. */
|
||||
/* Initialized in main: use the monotonic clock for timed waits. */
|
||||
pthread_cond_t wake_stop;
|
||||
pthread_cond_t stop_acknowledged;
|
||||
pthread_mutex_t queue_guard = PTHREAD_MUTEX_INITIALIZER;
|
||||
|
||||
|
|
@ -157,6 +157,7 @@ int main(int argc, char **argv)
|
|||
* too early or far too late. */
|
||||
pthread_condattr_init(&monotonic_attr);
|
||||
pthread_condattr_setclock(&monotonic_attr, CLOCK_MONOTONIC);
|
||||
pthread_cond_init(&wake_stop, &monotonic_attr);
|
||||
pthread_cond_init(&stop_acknowledged, &monotonic_attr);
|
||||
pthread_condattr_destroy(&monotonic_attr);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue