aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-05-07 14:07:54 +0200
committerMattias Andrée <maandree@operamail.com>2014-05-07 14:07:54 +0200
commit42f9663901ca01bb0ebd588748619c4344b74182 (patch)
tree557285f9a81ec81fa21ae1c67f04988958ad3567
parentm (diff)
downloadmds-42f9663901ca01bb0ebd588748619c4344b74182.tar.gz
mds-42f9663901ca01bb0ebd588748619c4344b74182.tar.bz2
mds-42f9663901ca01bb0ebd588748619c4344b74182.tar.xz
do not destroy the mutex and condition before we have used to to join with all slaves
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--src/mds-server.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mds-server.c b/src/mds-server.c
index 3b9264a..1e3362c 100644
--- a/src/mds-server.c
+++ b/src/mds-server.c
@@ -397,15 +397,15 @@ int main(int argc_, char** argv_)
int reexec_fd;
char shm_path[NAME_MAX + 1];
- /* Release resources. */
- pthread_mutex_destroy(&slave_mutex);
- pthread_cond_destroy(&slave_cond);
-
/* Join with all slaves threads. */
with_mutex(slave_mutex,
while (running_slaves > 0)
pthread_cond_wait(&slave_cond, &slave_mutex););
+ /* Release resources. */
+ pthread_mutex_destroy(&slave_mutex);
+ pthread_cond_destroy(&slave_cond);
+
/* Marshal the state of the server. */
xsnprintf(shm_path, SHM_PATH_PATTERN, (unsigned long int)pid);
reexec_fd = shm_open(shm_path, O_RDWR | O_CREAT | O_EXCL, S_IRWXU);