1 /* Multithreading primitives.
2 Copyright (C) 2005-2010 Free Software Foundation, Inc.
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 3, 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
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software Foundation,
16 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
18 /* Written by Bruno Haible <bruno@clisp.org>, 2005. */
22 /* ========================================================================= */
26 /* Use the POSIX threads library. */
31 # if PTHREAD_IN_USE_DETECTION_HARD
33 /* The function to be executed by a dummy thread. */
35 dummy_thread_func (void *arg)
41 glthread_in_use (void)
44 static int result; /* 1: linked with -lpthread, 0: only with libc */
50 if (pthread_create (&thread, NULL, dummy_thread_func, NULL) != 0)
51 /* Thread creation failed. */
55 /* Thread creation works. */
57 if (pthread_join (thread, &retval) != 0)
70 /* ========================================================================= */
72 /* This declaration is solely to ensure that after preprocessing
73 this file is never empty. */