summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Hommel <wolfgang.hommel@unibw.de>2021-07-17 19:44:20 +0200
committerWolfgang Hommel <wolfgang.hommel@unibw.de>2021-07-17 19:44:20 +0200
commit4bab3179ce148c7c182ac6d775c75ff45081c290 (patch)
treec45cce21dde7d4619ab844fba63aba78b5f53ab0
parent2090f5e548882130a6d8729a0807c5a44b025bd0 (diff)
downloadlibfaketime-4bab3179ce148c7c182ac6d775c75ff45081c290.tar.gz
Unlock mutex before exiting in case of error (fixes #340)
-rw-r--r--test/timetest.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/timetest.c b/test/timetest.c
index e7751c3..89e372d 100644
--- a/test/timetest.c
+++ b/test/timetest.c
@@ -83,6 +83,7 @@ void* pthread_test(void* args)
if (rt != ETIMEDOUT)
{
printf("pthread_cond_timedwait failed\n");
+ pthread_mutex_unlock(&fakeMutex);
exit(EXIT_FAILURE);
}
pthread_mutex_unlock(&fakeMutex);
@@ -105,6 +106,7 @@ void* pthread_test(void* args)
if (rt != ETIMEDOUT)
{
printf("pthread_cond_timedwait failed\n");
+ pthread_mutex_unlock(&fakeMutex);
exit(EXIT_FAILURE);
}
pthread_mutex_unlock(&fakeMutex);