1
/* Multithreading primitives.
2
Copyright (C) 2005-2009 Free Software Foundation, Inc.
4
This program is free software; you can redistribute it and/or modify it
5
under the terms of the GNU Library General Public License as published
6
by the Free Software Foundation; either version 2, or (at your option)
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
Library General Public License for more details.
14
You should have received a copy of the GNU Library General Public
15
License along with this program; if not, write to the Free Software
16
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
19
/* Written by Bruno Haible <bruno@clisp.org>, 2005. */
23
/* ========================================================================= */
27
/* Use the POSIX threads library. */
32
# if PTHREAD_IN_USE_DETECTION_HARD
34
/* The function to be executed by a dummy thread. */
36
dummy_thread_func (void *arg)
42
glthread_in_use (void)
45
static int result; /* 1: linked with -lpthread, 0: only with libc */
51
if (pthread_create (&thread, NULL, dummy_thread_func, NULL) != 0)
52
/* Thread creation failed. */
56
/* Thread creation works. */
58
if (pthread_join (thread, &retval) != 0)
71
/* ========================================================================= */
73
/* This declaration is solely to ensure that after preprocessing
74
this file is never empty. */