summaryrefslogtreecommitdiff
path: root/tests/mutex1.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/mutex1.c')
-rw-r--r--tests/mutex1.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/mutex1.c b/tests/mutex1.c
index 60bb4e7..c997963 100644
--- a/tests/mutex1.c
+++ b/tests/mutex1.c
@@ -13,18 +13,20 @@
#include "test.h"
-pthread_mutex_t mutex1;
+pthread_mutex_t mutex = NULL;
int
main()
{
- assert(pthread_mutex_init(&mutex1, NULL) == 0);
+ assert(mutex == NULL);
- assert(pthread_mutex_lock(&mutex1) == 0);
+ assert(pthread_mutex_init(&mutex, NULL) == 0);
- assert(pthread_mutex_unlock(&mutex1) == 0);
+ assert(mutex != NULL);
- assert(pthread_mutex_destroy(&mutex1) == 0);
+ assert(pthread_mutex_destroy(&mutex) == 0);
+
+ assert(mutex == NULL);
return 0;
}