diff options
Diffstat (limited to 'libgomp/config/posix/proc.c')
-rw-r--r-- | libgomp/config/posix/proc.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/libgomp/config/posix/proc.c b/libgomp/config/posix/proc.c index 3ee84f5c9d6..0c1096fb6b1 100644 --- a/libgomp/config/posix/proc.c +++ b/libgomp/config/posix/proc.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2005, 2006 Free Software Foundation, Inc. +/* Copyright (C) 2005, 2006, 2008 Free Software Foundation, Inc. Contributed by Richard Henderson <rth@redhat.com>. This file is part of the GNU OpenMP Library (libgomp). @@ -48,7 +48,7 @@ void gomp_init_num_threads (void) { #ifdef _SC_NPROCESSORS_ONLN - gomp_nthreads_var = sysconf (_SC_NPROCESSORS_ONLN); + gomp_global_icv.nthreads_var = sysconf (_SC_NPROCESSORS_ONLN); #endif } @@ -63,13 +63,14 @@ unsigned gomp_dynamic_max_threads (void) { unsigned n_onln, loadavg; + unsigned nthreads_var = gomp_icv (false)->nthreads_var; #ifdef _SC_NPROCESSORS_ONLN n_onln = sysconf (_SC_NPROCESSORS_ONLN); - if (n_onln > gomp_nthreads_var) - n_onln = gomp_nthreads_var; + if (n_onln > nthreads_var) + n_onln = nthreads_var; #else - n_onln = gomp_nthreads_var; + n_onln = nthreads_var; #endif loadavg = 0; @@ -96,7 +97,7 @@ omp_get_num_procs (void) #ifdef _SC_NPROCESSORS_ONLN return sysconf (_SC_NPROCESSORS_ONLN); #else - return gomp_nthreads_var; + return gomp_icv (false)->nthreads_var; #endif } |