aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-07-28 17:38:35 +0200
committerMattias Andrée <maandree@operamail.com>2014-07-28 17:38:35 +0200
commita8ed9b898568b200e17dd14b51d83bc70601d162 (patch)
treeb9c4d71ef3466380bc54f0fabaed521ad2961a81
parentmds-registry: all unmarshal failures are critical (diff)
downloadmds-a8ed9b898568b200e17dd14b51d83bc70601d162.tar.gz
mds-a8ed9b898568b200e17dd14b51d83bc70601d162.tar.bz2
mds-a8ed9b898568b200e17dd14b51d83bc70601d162.tar.xz
use of mutexe when removing protocols due to server closing
Signed-off-by: Mattias Andrée <maandree@operamail.com>
-rw-r--r--src/mds-registry.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mds-registry.c b/src/mds-registry.c
index b16e8d9..b0c6962 100644
--- a/src/mds-registry.c
+++ b/src/mds-registry.c
@@ -485,6 +485,8 @@ static int handle_close_message(void)
size_t* keys = NULL;
size_t* old_keys;
+ fail_if ((errno = pthread_mutex_lock(&reg_mutex)));
+
for (i = 0; i < received.header_count; i++)
if (startswith(received.headers[i], "Client closed: "))
{
@@ -518,6 +520,8 @@ static int handle_close_message(void)
free(command);
}
+ pthread_mutex_unlock(&reg_mutex);
+
free(keys);
return 0;
pfail: