~ubuntu-branches/ubuntu/gutsy/mysql-dfsg-5.0/gutsy

« back to all changes in this revision

Viewing changes to include/my_semaphore.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2007-04-03 09:43:01 UTC
  • mfrom: (1.1.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20070403094301-fnjhfr59hu72pvtg
Tags: 5.0.38-0ubuntu1
* Package the Enterprise version again (.37 was a community version), since
  Debian and we have always done so. This brings in a few more bug fixes and
  makes functional derivations less likely.
* debian/README.Maintainer: Add pointer to upstream download URL, since it
  is very hard to find the Enterprise versions.
* Disable 33_scripts__mysql_create_system_tables__no_test.dpatch, since that
  script was removed upstream.
* debian/patches/41_scripts__mysql_install_db.sh__no_test.dpatch: Adapted to
  changed formatting in new upstream version.
* Remove debian/patches/86_PATH_MAX.dpatch, fixed upstream.
* Add debian/patches/90_org_tables_definition.dpatch: Fix local variable
  declaration in libmysqld/sql_parse.cc to fix compilation with
  EMBEDDED_LIBRARY.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Module: semaphore.h
3
 
 *
4
 
 * Purpose:
5
 
 *      Semaphores aren't actually part of the PThreads standard.
6
 
 *      They are defined by the POSIX Standard:
7
 
 *
8
 
 *              POSIX 1003.1b-1993      (POSIX.1b)
9
 
 *
10
 
 * Pthreads-win32 - POSIX Threads Library for Win32
11
 
 * Copyright (C) 1998
12
 
 *
13
 
 * This library is free software; you can redistribute it and/or
14
 
 * modify it under the terms of the GNU Library General Public
15
 
 * License as published by the Free Software Foundation; either
16
 
 * version 2 of the License, or (at your option) any later version.
17
 
 *
18
 
 * This library is distributed in the hope that it will be useful,
19
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
21
 
 * Library General Public License for more details.
22
 
 *
23
 
 * You should have received a copy of the GNU Library General Public
24
 
 * License along with this library; if not, write to the Free
25
 
 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
26
 
 * MA 02111-1307, USA
27
 
 */
28
 
 
29
 
/* This is hacked by Monty to be included in mysys library */
30
 
 
31
 
#ifndef _my_semaphore_h_
32
 
#define _my_semaphore_h_
33
 
 
34
 
#ifdef THREAD
35
 
 
36
 
C_MODE_START
37
 
#ifdef HAVE_SEMAPHORE_H
38
 
#include <semaphore.h>
39
 
#elif !defined(__bsdi__)
40
 
#ifdef __WIN__
41
 
typedef HANDLE sem_t;
42
 
#else
43
 
typedef struct {
44
 
  pthread_mutex_t mutex;
45
 
  pthread_cond_t  cond;
46
 
  uint            count;
47
 
} sem_t;
48
 
#endif /* __WIN__ */
49
 
 
50
 
int sem_init(sem_t * sem, int pshared, unsigned int value);
51
 
int sem_destroy(sem_t * sem);
52
 
int sem_trywait(sem_t * sem);
53
 
int sem_wait(sem_t * sem);
54
 
int sem_post(sem_t * sem);
55
 
int sem_post_multiple(sem_t * sem, unsigned int count);
56
 
int sem_getvalue(sem_t * sem, unsigned int * sval);
57
 
 
58
 
#endif /* !__bsdi__ */
59
 
 
60
 
C_MODE_END
61
 
 
62
 
#endif /* THREAD */
63
 
 
64
 
#endif /* !_my_semaphore_h_ */