aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2017-06-19 17:04:32 +0200
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2017-06-19 17:04:32 +0200
commit90a0f8faeab551e571b483e016e3bcbe232fe86c (patch)
treed4124dfbf0d9b40dbeaecc32dcadaceaf5ac884b
parentc4798a34b7759d578ea48e80e6a7f1ece22ddbca (diff)
downloadstorage-90a0f8faeab551e571b483e016e3bcbe232fe86c.zip
storage-90a0f8faeab551e571b483e016e3bcbe232fe86c.tar.bz2
Unlocks uselessly locked mutex during merging.
-rw-r--r--src/server/server_worker_data_merger.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/server/server_worker_data_merger.c b/src/server/server_worker_data_merger.c
index c0df221..07052b7 100644
--- a/src/server/server_worker_data_merger.c
+++ b/src/server/server_worker_data_merger.c
@@ -117,8 +117,10 @@ static void merge_thread_data
return;
}
+ pthread_mutex_unlock(&(collection->mutex));
+
/** Append content of 'in' to 'out' ****************************************/
- while ((c = (char) fgetc(in)) != EOF)
+ while ((c = fgetc(in)) != EOF)
{
if (fputc(c, out) == EOF)
{
@@ -141,6 +143,8 @@ static void merge_thread_data
fclose(in);
fclose(out);
+ pthread_mutex_lock(&(collection->mutex));
+
return;
}