From 6b73edd95d603e27d55d4905134ac1327d426534 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Mon, 27 Mar 2017 21:41:36 +0200 Subject: New upstream version 0.9.7 --- tests/glthread/thread.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'tests/glthread/thread.h') 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) -- cgit v1.2.3