diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2016-11-23 11:22:54 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2016-11-23 11:22:54 +0100 |
commit | c7b3ab9553dea50ae7151d9847c1b62a0213f275 (patch) | |
tree | f1c10468823d27232d85cb6bfb858824e3597718 /source | |
parent | deb5839a5b0d11c4a079a7939fe88aa07101aecc (diff) | |
download | mupdf-c7b3ab9553dea50ae7151d9847c1b62a0213f275.tar.xz |
Fix mu-threads build on linux.
Diffstat (limited to 'source')
-rw-r--r-- | source/helpers/mu-threads/mu-threads.c | 6 |
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; } |