diff options
author | Michał Łyszczek <michal.lyszczek@bofc.pl> | 2018-09-25 23:26:38 +0200 |
---|---|---|
committer | Michał Łyszczek <michal.lyszczek@bofc.pl> | 2018-09-25 23:26:38 +0200 |
commit | 4cf3de451493ed187d8120a3afef3fd7d1f5ca33 (patch) | |
tree | f18e091f23f9be2172a177a11cef874814ecf54c | |
parent | 51d42ecd5162a1299bfe7234edfe5f5b6f395859 (diff) | |
download | librb-4cf3de451493ed187d8120a3afef3fd7d1f5ca33.tar.gz librb-4cf3de451493ed187d8120a3afef3fd7d1f5ca33.tar.bz2 librb-4cf3de451493ed187d8120a3afef3fd7d1f5ca33.zip |
fix: declare mutex only when threads are enable
it cause some compile errors on some platforms
-rw-r--r-- | tests.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -69,14 +69,15 @@ static int multi; static int t_num_producers; static int t_num_consumers; static int data[255]; -static pthread_mutex_t multi_mutex; -static pthread_mutex_t multi_mutex_count; static unsigned int multi_index; static volatile unsigned int multi_index_count; mt_defs(); #if ENABLE_THREADS +static pthread_mutex_t multi_mutex; +static pthread_mutex_t multi_mutex_count; + static void *consumer(void *arg) { struct tdata *data = arg; |