summaryrefslogtreecommitdiff
path: root/tests/glthread
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2017-03-27 21:41:36 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2017-03-27 21:41:36 +0200
commit6b73edd95d603e27d55d4905134ac1327d426534 (patch)
treee0b9334e2637f17696c796ac13b2c39294bf9233 /tests/glthread
parent0250cb64565a7d5238bbc751225d4b0236ef8316 (diff)
New upstream version 0.9.7upstream/0.9.7
Diffstat (limited to 'tests/glthread')
-rw-r--r--tests/glthread/thread.c4
-rw-r--r--tests/glthread/thread.h11
-rw-r--r--tests/glthread/yield.h2
3 files changed, 13 insertions, 4 deletions
diff --git a/tests/glthread/thread.c b/tests/glthread/thread.c
index d3829ce..8f2a8e2 100644
--- a/tests/glthread/thread.c
+++ b/tests/glthread/thread.c
@@ -1,5 +1,5 @@
/* Creating and controlling threads.
- Copyright (C) 2005-2015 Free Software Foundation, Inc.
+ Copyright (C) 2005-2016 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -33,7 +33,7 @@
#include <pthread.h>
-#ifdef PTW32_VERSION
+#if defined PTW32_VERSION || defined __MVS__
const gl_thread_t gl_null_thread /* = { .p = NULL } */;
diff --git a/tests/glthread/thread.h b/tests/glthread/thread.h
index 2817437..4488a9e 100644
--- a/tests/glthread/thread.h
+++ b/tests/glthread/thread.h
@@ -1,5 +1,5 @@
/* Creating and controlling threads.
- Copyright (C) 2005-2015 Free Software Foundation, Inc.
+ Copyright (C) 2005-2016 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -172,6 +172,15 @@ typedef pthread_t gl_thread_t;
# define gl_thread_self_pointer() \
(pthread_in_use () ? pthread_self ().p : NULL)
extern const gl_thread_t gl_null_thread;
+# elif defined __MVS__
+ /* On IBM z/OS, pthread_t is a struct with an 8-byte '__' field.
+ The first three bytes of this field appear to uniquely identify a
+ pthread_t, though not necessarily representing a pointer. */
+# define gl_thread_self() \
+ (pthread_in_use () ? pthread_self () : gl_null_thread)
+# define gl_thread_self_pointer() \
+ (pthread_in_use () ? *((void **) pthread_self ().__) : NULL)
+extern const gl_thread_t gl_null_thread;
# else
# define gl_thread_self() \
(pthread_in_use () ? pthread_self () : (pthread_t) NULL)
diff --git a/tests/glthread/yield.h b/tests/glthread/yield.h
index b18db5b..19224c6 100644
--- a/tests/glthread/yield.h
+++ b/tests/glthread/yield.h
@@ -1,5 +1,5 @@
/* Yielding the processor to other threads and processes.
- Copyright (C) 2005-2015 Free Software Foundation, Inc.
+ Copyright (C) 2005-2016 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by