-/* Copyright (C) 2004-2017 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2004.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
#include <errno.h>
+#include <limits.h>
#include <fcntl.h>
#include <pthread.h>
#include <stdbool.h>
pthread_cond_t cv = PTHREAD_COND_INITIALIZER;
pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
bool exiting;
-int fd, count, spins, nn;
+int fd, spins, nn;
+enum { count = 8 }; /* Number of worker threads. */
void *
tf (void *id)
return 1;
}
- count = sysconf (_SC_NPROCESSORS_ONLN);
- if (count <= 0)
- count = 1;
- count *= 8;
-
pthread_t th[count + 1];
pthread_attr_t attr;
int i, ret, sz;
pthread_attr_init (&attr);
- sz = __getpagesize ();
+ sz = sysconf (_SC_PAGESIZE);
if (sz < PTHREAD_STACK_MIN)
sz = PTHREAD_STACK_MIN;
pthread_attr_setstacksize (&attr, sz);