aboutsummaryrefslogtreecommitdiffstats
path: root/tests/threads.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/threads.c')
-rw-r--r--tests/threads.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/threads.c b/tests/threads.c
new file mode 100644
index 0000000..18b0145
--- /dev/null
+++ b/tests/threads.c
@@ -0,0 +1,21 @@
+#include <pthread.h>
+#include <unistd.h>
+
+static int x;
+
+static void *
+thread_main(void *data)
+{
+ sleep(1);
+ return data;
+}
+
+int
+main(void)
+{
+ pthread_t thread;
+ if (pthread_create(&thread, NULL, thread_main, &x))
+ return 2;
+ sleep(2);
+ return 1;
+}