speechd-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 03/10] Fix termination of threads in spd_close


From: Boris Dušek
Subject: [PATCH 03/10] Fix termination of threads in spd_close
Date: Mon, 23 Jul 2012 15:24:14 +0200

From: Boris Dus?ek <address@hidden>
To: address@hidden

---
 src/api/c/libspeechd.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/api/c/libspeechd.c b/src/api/c/libspeechd.c
index 25e5250..2b26ba4 100644
--- a/src/api/c/libspeechd.c
+++ b/src/api/c/libspeechd.c
@@ -559,6 +559,9 @@ void spd_close(SPDConnection * connection)
 
        pthread_mutex_lock(connection->ssip_mutex);
 
+       /* close the socket */
+       close(connection->socket);
+
        if (connection->mode == SPD_MODE_THREADED) {
                pthread_cancel(*connection->events_thread);
                pthread_mutex_destroy(connection->mutex_reply_ready);
@@ -569,9 +572,6 @@ void spd_close(SPDConnection * connection)
                connection->mode = SPD_MODE_SINGLE;
        }
 
-       /* close the socket */
-       close(connection->socket);
-
        pthread_mutex_unlock(connection->ssip_mutex);
 
        pthread_mutex_destroy(connection->ssip_mutex);
-- 
1.7.7.5 (Apple Git-26)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]