5
* Semaphores aren't actually part of the PThreads standard.
6
* They are defined by the POSIX Standard:
8
* POSIX 1003.1b-1993 (POSIX.1b)
10
* Pthreads-win32 - POSIX Threads Library for Win32
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.
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.
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,
29
/* This is hacked by Monty to be included in mysys library */
31
#ifndef _my_semaphore_h_
32
#define _my_semaphore_h_
37
#ifdef HAVE_SEMAPHORE_H
38
#include <semaphore.h>
39
#elif !defined(__bsdi__)
44
pthread_mutex_t mutex;
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);
58
#endif /* !__bsdi__ */
64
#endif /* !_my_semaphore_h_ */