summaryrefslogtreecommitdiff
path: root/source/helpers
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2016-11-23 11:22:54 +0100
committerTor Andersson <tor.andersson@artifex.com>2016-11-23 11:22:54 +0100
commitc7b3ab9553dea50ae7151d9847c1b62a0213f275 (patch)
treef1c10468823d27232d85cb6bfb858824e3597718 /source/helpers
parentdeb5839a5b0d11c4a079a7939fe88aa07101aecc (diff)
downloadmupdf-c7b3ab9553dea50ae7151d9847c1b62a0213f275.tar.xz
Fix mu-threads build on linux.
Diffstat (limited to 'source/helpers')
-rw-r--r--source/helpers/mu-threads/mu-threads.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/helpers/mu-threads/mu-threads.c b/source/helpers/mu-threads/mu-threads.c
index bbc87d1a..847c3368 100644
--- a/source/helpers/mu-threads/mu-threads.c
+++ b/source/helpers/mu-threads/mu-threads.c
@@ -245,7 +245,7 @@ int mu_create_thread(mu_thread *th, mu_thread_fn *fn, void *arg)
void mu_destroy_thread(mu_thread *th)
{
- const static mu_thread empty = { 0 };
+ const static mu_thread empty; /* static objects are always initialized to zero */
if (memcmp(th, &empty, sizeof(empty)) == 0)
return;
@@ -261,9 +261,11 @@ int mu_create_mutex(mu_mutex *mutex)
void mu_destroy_mutex(mu_mutex *mutex)
{
- const static mu_mutex empty = { 0 };
+ const static mu_mutex empty; /* static objects are always initialized to zero */
+
if (memcmp(mutex, &empty, sizeof(empty)) == 0)
return;
+
(void)pthread_mutex_destroy(&mutex->mutex);
*mutex = empty;
}