~ubuntu-branches/ubuntu/precise/wget/precise-proposed

« back to all changes in this revision

Viewing changes to lib/glthread/threadlib.c

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2011-10-19 00:00:09 UTC
  • mfrom: (2.1.13 sid)
  • Revision ID: james.westby@ubuntu.com-20111019000009-8p33w3wz4b1rdri0
Tags: 1.13-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - Add wget-udeb to ship wget.gnu as alternative to busybox wget
    implementation.
  - Depend on libssl-dev 0.9.8k-7ubuntu4 (LP: #503339)
* Dropped changes, superseded in Debian:
  - Keep build dependencies in main:
    + debian/control: remove info2man build-dep
    + debian/patches/series: disable wget-infopod_generated_manpage
  - Mark wget Multi-Arch: foreign, so packages that aren't of the same arch
    can depend on it.
* Pass --with-ssl=openssl; we don't want to use gnutls, there's no udeb for
  it.
* Add a second build pass for the udeb, so we can build without libidn.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- buffer-read-only: t -*- vi: set ro: */
 
2
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
 
3
/* Multithreading primitives.
 
4
   Copyright (C) 2005-2011 Free Software Foundation, Inc.
 
5
 
 
6
   This program is free software; you can redistribute it and/or modify
 
7
   it under the terms of the GNU General Public License as published by
 
8
   the Free Software Foundation; either version 3, or (at your option)
 
9
   any later version.
 
10
 
 
11
   This program is distributed in the hope that it will be useful,
 
12
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
   GNU General Public License for more details.
 
15
 
 
16
   You should have received a copy of the GNU General Public License
 
17
   along with this program; if not, write to the Free Software Foundation,
 
18
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
19
 
 
20
/* Written by Bruno Haible <bruno@clisp.org>, 2005.  */
 
21
 
 
22
#include <config.h>
 
23
 
 
24
/* ========================================================================= */
 
25
 
 
26
#if USE_POSIX_THREADS
 
27
 
 
28
/* Use the POSIX threads library.  */
 
29
 
 
30
# include <pthread.h>
 
31
# include <stdlib.h>
 
32
 
 
33
# if PTHREAD_IN_USE_DETECTION_HARD
 
34
 
 
35
/* The function to be executed by a dummy thread.  */
 
36
static void *
 
37
dummy_thread_func (void *arg)
 
38
{
 
39
  return arg;
 
40
}
 
41
 
 
42
int
 
43
glthread_in_use (void)
 
44
{
 
45
  static int tested;
 
46
  static int result; /* 1: linked with -lpthread, 0: only with libc */
 
47
 
 
48
  if (!tested)
 
49
    {
 
50
      pthread_t thread;
 
51
 
 
52
      if (pthread_create (&thread, NULL, dummy_thread_func, NULL) != 0)
 
53
        /* Thread creation failed.  */
 
54
        result = 0;
 
55
      else
 
56
        {
 
57
          /* Thread creation works.  */
 
58
          void *retval;
 
59
          if (pthread_join (thread, &retval) != 0)
 
60
            abort ();
 
61
          result = 1;
 
62
        }
 
63
      tested = 1;
 
64
    }
 
65
  return result;
 
66
}
 
67
 
 
68
# endif
 
69
 
 
70
#endif
 
71
 
 
72
/* ========================================================================= */
 
73
 
 
74
/* This declaration is solely to ensure that after preprocessing
 
75
   this file is never empty.  */
 
76
typedef int dummy;