1 /* Multithreading primitives.
2 Copyright (C) 2005-2012 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, see <http://www.gnu.org/licenses/>. */
17 /* Written by Bruno Haible <bruno@clisp.org>, 2005. */
21 /* ========================================================================= */
25 /* Use the POSIX threads library. */
30 # if PTHREAD_IN_USE_DETECTION_HARD
32 /* The function to be executed by a dummy thread. */
34 dummy_thread_func (void *arg)
40 glthread_in_use (void)
43 static int result; /* 1: linked with -lpthread, 0: only with libc */
49 if (pthread_create (&thread, NULL, dummy_thread_func, NULL) != 0)
50 /* Thread creation failed. */
54 /* Thread creation works. */
56 if (pthread_join (thread, &retval) != 0)
69 /* ========================================================================= */
71 /* This declaration is solely to ensure that after preprocessing
72 this file is never empty. */