summaryrefslogtreecommitdiff
path: root/mit-pthreads/include
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2002-06-20 15:25:02 +0300
committerunknown <monty@hundin.mysql.fi>2002-06-20 15:25:02 +0300
commit950df73713d6eca34de8be1f9771d40a8abeadc4 (patch)
tree7eee86ca5c680d305ade1203f3945cee038dbd46 /mit-pthreads/include
parentccf18acc242f33fffca016c1e28c99e6e4e443b7 (diff)
downloadmariadb-git-950df73713d6eca34de8be1f9771d40a8abeadc4.tar.gz
Fixed some bugs after last merge
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
Diffstat (limited to 'mit-pthreads/include')
-rw-r--r--mit-pthreads/include/Makefile.inc2
-rw-r--r--mit-pthreads/include/pthread/ac-types.h4
-rw-r--r--mit-pthreads/include/semaphore.h20
3 files changed, 24 insertions, 2 deletions
diff --git a/mit-pthreads/include/Makefile.inc b/mit-pthreads/include/Makefile.inc
index b7fe59d5f0d..72554b638d2 100644
--- a/mit-pthreads/include/Makefile.inc
+++ b/mit-pthreads/include/Makefile.inc
@@ -7,7 +7,7 @@
FILES= cond.h copyright.h fd.h fd_pipe.h kernel.h mutex.h posix.h \
- pthread.h pthread_attr.h queue.h util.h
+ pthread.h pthread_attr.h queue.h util.h semaphore.h
# Machine dependent header file
MFILE= ${.CURDIR}/arch/${MACHINE}/machdep.h
diff --git a/mit-pthreads/include/pthread/ac-types.h b/mit-pthreads/include/pthread/ac-types.h
index 7fa4568817f..4dd20a6f748 100644
--- a/mit-pthreads/include/pthread/ac-types.h
+++ b/mit-pthreads/include/pthread/ac-types.h
@@ -6,5 +6,7 @@
#define pthread_ssize_t int
#define pthread_time_t long
#define pthread_off_t long
-#define pthread_va_list void *
+#ifdef NOT_USED /* Removed by monty becasue of conflicts on Linux */
+#define pthread_va_list char *
+#endif
#endif
diff --git a/mit-pthreads/include/semaphore.h b/mit-pthreads/include/semaphore.h
new file mode 100644
index 00000000000..7a593287bc4
--- /dev/null
+++ b/mit-pthreads/include/semaphore.h
@@ -0,0 +1,20 @@
+/*
+ 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);