mirror of
https://github.com/MariaDB/server.git
synced 2025-08-09 22:24:09 +03:00
Added semaphore support to MIT-pthreads. Docs/manual.texi: Updated benchmark data configure.in: Portability fix for compiling MIT-pthreads with gcc 3.0.x (Still not perfect) include/my_semaphore.h: Cleanup mit-pthreads/Changes-mysql: Added semaphore support mit-pthreads/include/Makefile.inc: Added semaphore support mit-pthreads/include/pthread/ac-types.h: Added semaphore support mit-pthreads/pthreads/GNUmakefile.inc: Added semaphore support mit-pthreads/pthreads/Makefile.inc: Added semaphore support mit-pthreads/stdio/xprintf.c: Added semaphore support mysql-test/r/rpl_alter.result: Fixed test results after merge with 3.23 sql/ha_isam.cc: Fixed core dump after merge sql/ha_isam.h: Fixed core dump after merge sql/mini_client.cc: P
21 lines
528 B
C
21 lines
528 B
C
/*
|
|
This is written by Sergei Golubchik for MySQL AB and is in public domain.
|
|
|
|
Simple implementation of semaphores, needed to compile MySQL with
|
|
MIT-pthreads.
|
|
*/
|
|
|
|
typedef struct {
|
|
pthread_mutex_t mutex;
|
|
pthread_cond_t cond;
|
|
uint count;
|
|
} sem_t;
|
|
|
|
int sem_init(sem_t * sem, int pshared, uint value);
|
|
int sem_destroy(sem_t * sem);
|
|
int sem_wait(sem_t * sem);
|
|
int sem_trywait(sem_t * sem);
|
|
int sem_post (sem_t * sem);
|
|
int sem_post_multiple(sem_t * sem, uint count);
|
|
int sem_getvalue (sem_t * sem, uint *sval);
|