summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2002-06-29 00:16:15 +0300
committerunknown <monty@hundin.mysql.fi>2002-06-29 00:16:15 +0300
commit370016677af391c58c03a0eca198936b3ac5d382 (patch)
tree4ad1a20d59a1252f985bb184bc8e51fc1988c045 /include
parent7311cbe7dee5980d921ec43177fd268783eb18e2 (diff)
downloadmariadb-git-370016677af391c58c03a0eca198936b3ac5d382.tar.gz
Added support for semaphores in mysys.
(Needed for query cache for systems which doesn't have native semaphores) mysys/my_getopt.c: Safety fix. mysys/my_winsem.c: Shange all semaphore code to be uniform mysys/thr_rwlock.c: cleanup sql/gen_lex_hash.cc: Error message if wrong number of arguments. sql/slave.cc: R
Diffstat (limited to 'include')
-rw-r--r--include/my_semaphore.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/include/my_semaphore.h b/include/my_semaphore.h
index 36c4b1a4740..aecbde09511 100644
--- a/include/my_semaphore.h
+++ b/include/my_semaphore.h
@@ -33,20 +33,29 @@
C_MODE_START
-#ifndef __WIN__
+#ifdef HAVE_SEMAPHORE_H
#include <semaphore.h>
#else
+#ifdef __WIN__
typedef HANDLE sem_t;
+#else
+typedef struct {
+ pthread_mutex_t mutex;
+ pthread_cond_t cond;
+ uint count;
+} sem_t;
+#endif
+
int sem_init(sem_t * sem, int pshared, unsigned int value);
int sem_destroy(sem_t * sem);
int sem_trywait(sem_t * sem);
int sem_wait(sem_t * sem);
int sem_post(sem_t * sem);
-int sem_post_multiple(sem_t * sem,int count);
-int sem_getvalue(sem_t * sem, int * sval);
+int sem_post_multiple(sem_t * sem, unsigned int count);
+int sem_getvalue(sem_t * sem, unsigned int * sval);
-#endif /* __WIN__ */
+#endif
C_MODE_END
#endif /* !_my_semaphore_h_ */