summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2021-02-07 20:11:24 -0300
committerSebastian <sebasjm@gmail.com>2021-02-07 20:11:24 -0300
commit93347b3904962c80d6aeba0c3be4a75af2a13e83 (patch)
tree7f5a3bd0ae50634261bed1245d77e650ed9df87a /src/util
parent07a5f6fb821ae48efa877215360a5c9c7cfc6fa4 (diff)
downloadexchange-93347b3904962c80d6aeba0c3be4a75af2a13e83.tar.gz
exchange-93347b3904962c80d6aeba0c3be4a75af2a13e83.tar.bz2
exchange-93347b3904962c80d6aeba0c3be4a75af2a13e83.zip
fix #6745
Diffstat (limited to 'src/util')
-rw-r--r--src/util/taler-exchange-secmod-eddsa.c17
-rw-r--r--src/util/taler-exchange-secmod-rsa.c17
2 files changed, 20 insertions, 14 deletions
diff --git a/src/util/taler-exchange-secmod-eddsa.c b/src/util/taler-exchange-secmod-eddsa.c
index 89ec2b606..e8670d976 100644
--- a/src/util/taler-exchange-secmod-eddsa.c
+++ b/src/util/taler-exchange-secmod-eddsa.c
@@ -1427,13 +1427,16 @@ do_shutdown (void *cls)
done_task = NULL;
}
/* shut down worker threads */
- GNUNET_assert (0 == pthread_mutex_lock (&work_lock));
- in_shutdown = true;
- GNUNET_assert (0 == pthread_cond_broadcast (&work_cond));
- GNUNET_assert (0 == pthread_mutex_unlock (&work_lock));
- for (unsigned int i = 0; i<num_workers; i++)
- GNUNET_assert (0 == pthread_join (workers[i],
- NULL));
+ if (NULL != workers)
+ {
+ GNUNET_assert (0 == pthread_mutex_lock (&work_lock));
+ in_shutdown = true;
+ GNUNET_assert (0 == pthread_cond_broadcast (&work_cond));
+ GNUNET_assert (0 == pthread_mutex_unlock (&work_lock));
+ for (unsigned int i = 0; i<num_workers; i++)
+ GNUNET_assert (0 == pthread_join (workers[i],
+ NULL));
+ }
if (NULL != done_signal)
{
GNUNET_break (GNUNET_OK ==
diff --git a/src/util/taler-exchange-secmod-rsa.c b/src/util/taler-exchange-secmod-rsa.c
index 2f1cae2c9..ebd2d375b 100644
--- a/src/util/taler-exchange-secmod-rsa.c
+++ b/src/util/taler-exchange-secmod-rsa.c
@@ -1798,13 +1798,16 @@ do_shutdown (void *cls)
done_task = NULL;
}
/* shut down worker threads */
- GNUNET_assert (0 == pthread_mutex_lock (&work_lock));
- in_shutdown = true;
- GNUNET_assert (0 == pthread_cond_broadcast (&work_cond));
- GNUNET_assert (0 == pthread_mutex_unlock (&work_lock));
- for (unsigned int i = 0; i<num_workers; i++)
- GNUNET_assert (0 == pthread_join (workers[i],
- NULL));
+ if (NULL != workers)
+ {
+ GNUNET_assert (0 == pthread_mutex_lock (&work_lock));
+ in_shutdown = true;
+ GNUNET_assert (0 == pthread_cond_broadcast (&work_cond));
+ GNUNET_assert (0 == pthread_mutex_unlock (&work_lock));
+ for (unsigned int i = 0; i<num_workers; i++)
+ GNUNET_assert (0 == pthread_join (workers[i],
+ NULL));
+ }
if (NULL != done_signal)
{
GNUNET_break (GNUNET_OK ==