aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2012-12-14 11:01:41 +0200
committerLasse Collin <lasse.collin@tukaani.org>2012-12-14 11:01:41 +0200
commit2ebbb994e367f55f2561aa7c9e7451703c171f2f (patch)
treee997376c98a2e62428ecaa4583f8fce6fa540c2f /src
parentxz: Mention --threads in --help. (diff)
downloadxz-2ebbb994e367f55f2561aa7c9e7451703c171f2f.tar.xz
liblzma: Fix mythread_sync for nested locking.
Diffstat (limited to '')
-rw-r--r--src/common/mythread.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/common/mythread.h b/src/common/mythread.h
index c538dea2..637b8ac3 100644
--- a/src/common/mythread.h
+++ b/src/common/mythread.h
@@ -70,8 +70,9 @@ do { \
/// things down at all compared to plain pthread_mutex_lock(&mutex)
/// and pthread_mutex_unlock(&mutex) calls.
///
-#define mythread_sync(mutex) mythread_sync_helper(mutex, __LINE__)
-#define mythread_sync_helper(mutex, line) \
+#define mythread_sync(mutex) mythread_sync_helper1(mutex, __LINE__)
+#define mythread_sync_helper1(mutex, line) mythread_sync_helper2(mutex, line)
+#define mythread_sync_helper2(mutex, line) \
for (unsigned int mythread_i_ ## line = 0; \
mythread_i_ ## line \
? (pthread_mutex_unlock(&(mutex)), 0) \