From 42f9663901ca01bb0ebd588748619c4344b74182 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 7 May 2014 14:07:54 +0200 Subject: do not destroy the mutex and condition before we have used to to join with all slaves MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/mds-server.c | 8 ++++---- 1 file 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); -- cgit v1.2.3-70-g09d2