summaryrefslogtreecommitdiff
path: root/tests/mutex1.c
diff options
context:
space:
mode:
authorbje <bje>1998-10-04 05:35:58 +0000
committerbje <bje>1998-10-04 05:35:58 +0000
commit5304897a03ee218b5b36d2c5e7f83d970c4b1b46 (patch)
treec630b581f94e61332a6f34c25235f0ffb1cad997 /tests/mutex1.c
parentc6332c1963c7c13261192f2a406f3dbaf3a18a97 (diff)
1998-10-04 Ben Elliston <bje@cygnus.com>
* tests/mutex1.c: New basic test for mutex functions (it passes).
Diffstat (limited to 'tests/mutex1.c')
-rw-r--r--tests/mutex1.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/mutex1.c b/tests/mutex1.c
new file mode 100644
index 0000000..087483d
--- /dev/null
+++ b/tests/mutex1.c
@@ -0,0 +1,17 @@
+/*
+ * mutex1.c
+ *
+ * Create a simple mutex object, lock it, and then unlock it again.
+ * This is the simplest test of the pthread mutex family that we can do.
+ */
+
+#include <pthread.h>
+
+pthread_mutex_t mutex1;
+
+main()
+{
+ pthread_mutex_init(&mutex1, NULL);
+ pthread_mutex_lock(&mutex1);
+ pthread_mutex_unlock(&mutex1);
+}