Browse Source

Fix the mutex logic in fifo.c from the espeak_ng_STATUS changes.

master
Reece H. Dunn 9 years ago
parent
commit
76d8c67b52
1 changed files with 9 additions and 3 deletions
  1. 9
    3
      src/libespeak-ng/fifo.c

+ 9
- 3
src/libespeak-ng/fifo.c View File

if ((status = pthread_mutex_lock(&my_mutex)) != ENS_OK) if ((status = pthread_mutex_lock(&my_mutex)) != ENS_OK)
return status; return status;


if ((status = push(the_command)) != ENS_OK)
if ((status = push(the_command)) != ENS_OK) {
pthread_mutex_unlock(&my_mutex);
return status; return status;
}


if ((status = pthread_mutex_unlock(&my_mutex)) != ENS_OK) if ((status = pthread_mutex_unlock(&my_mutex)) != ENS_OK)
return status; return status;
if (node_counter+1 >= MAX_NODE_COUNTER) if (node_counter+1 >= MAX_NODE_COUNTER)
return ENS_FIFO_BUFFER_FULL; return ENS_FIFO_BUFFER_FULL;


if ((status = push(command1)) != ENS_OK)
if ((status = push(command1)) != ENS_OK) {
pthread_mutex_unlock(&my_mutex);
return status; return status;
}


if ((status = push(command2)) != ENS_OK)
if ((status = push(command2)) != ENS_OK) {
pthread_mutex_unlock(&my_mutex);
return status; return status;
}


if ((status = pthread_mutex_unlock(&my_mutex)) != ENS_OK) if ((status = pthread_mutex_unlock(&my_mutex)) != ENS_OK)
return status; return status;

Loading…
Cancel
Save