aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Koenig <tkoenig@gcc.gnu.org>2018-09-02 20:10:58 +0000
committerThomas Koenig <tkoenig@gcc.gnu.org>2018-09-02 20:10:58 +0000
commit591f80ec0584e86208bcdfa9cd6aff1fec4c6a63 (patch)
tree7cdf3a1e38e2ccfa63060af300a6097d2efb3cf7
parent0c4503c1c0f2aa55f2fbf152b9f70145d17c3948 (diff)
2018-09-02 Thomas Koenig <tkoenig@gcc.gnu.org>gfortran-caf
* caf/multi.c: Remove static variables _gfortrani_caf_this_image and caf_num_images. * runtime/environ.c: Add caf_num_images. * runtime/compile_options.c: Add _gfortrani_caf_this_image. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gfortran-caf@264045 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--libgfortran/ChangeLog.dev6
-rw-r--r--libgfortran/caf/multi.c2
-rw-r--r--libgfortran/runtime/compile_options.c4
-rw-r--r--libgfortran/runtime/environ.c1
4 files changed, 11 insertions, 2 deletions
diff --git a/libgfortran/ChangeLog.dev b/libgfortran/ChangeLog.dev
index b051202f12f..1bdd4e57b2e 100644
--- a/libgfortran/ChangeLog.dev
+++ b/libgfortran/ChangeLog.dev
@@ -1,4 +1,10 @@
2018-09-02 Thomas Koenig <tkoenig@gcc.gnu.org>
+ * caf/multi.c: Remove static variables _gfortrani_caf_this_image
+ and caf_num_images.
+ * runtime/environ.c: Add caf_num_images.
+ * runtime/compile_options.c: Add _gfortrani_caf_this_image.
+
+2018-09-02 Thomas Koenig <tkoenig@gcc.gnu.org>
* caf/multi.c (_gfortran_caf_register): New function.
(_gfortran_caf_lock): New function.
diff --git a/libgfortran/caf/multi.c b/libgfortran/caf/multi.c
index f4a700ce88f..474b8f5f32c 100644
--- a/libgfortran/caf/multi.c
+++ b/libgfortran/caf/multi.c
@@ -59,8 +59,6 @@ typedef struct cond_t {
/* Static variables. */
-__thread int _gfortrani_caf_this_image = -1;
-int caf_num_images = -1;
pthread_barrier_t sync_all_barrier;
pthread_t *tidlist;
diff --git a/libgfortran/runtime/compile_options.c b/libgfortran/runtime/compile_options.c
index ef8777e1505..8b46a9c10f3 100644
--- a/libgfortran/runtime/compile_options.c
+++ b/libgfortran/runtime/compile_options.c
@@ -142,6 +142,10 @@ backtrace_handler (int signum)
extern void set_options (int , int []);
export_proto(set_options);
+/* Thread-local storage which image we are in. */
+
+__thread int _gfortrani_caf_this_image = -1;
+
void
set_options (int num, int options[])
{
diff --git a/libgfortran/runtime/environ.c b/libgfortran/runtime/environ.c
index c65754b73ef..5fa12bdb409 100644
--- a/libgfortran/runtime/environ.c
+++ b/libgfortran/runtime/environ.c
@@ -32,6 +32,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include <unistd.h>
#endif
+int caf_num_images = -1;
/* Implementation of secure_getenv() for targets where it is not
provided. */