summaryrefslogtreecommitdiff
path: root/mysys/my_os2mutex.c
diff options
context:
space:
mode:
authormonty@mashka.mysql.fi <>2003-01-28 08:38:28 +0200
committermonty@mashka.mysql.fi <>2003-01-28 08:38:28 +0200
commit689578a0997f54c590bcf4791e30710602851bc4 (patch)
treeb916d4acfbe4f32ab06b052fd06c072f858bdce1 /mysys/my_os2mutex.c
parent1bdd1d0626fdb8f858a3c4bf82e0064ee19b042d (diff)
downloadmariadb-git-689578a0997f54c590bcf4791e30710602851bc4.tar.gz
Fixes for Netware
Call pthread_mutex_destroy() on not used mutex. Changed comments in .h and .c files from // -> /* */ Added detection of mutex on which one didn't call pthread_mutex_destroy() Fixed bug in create_tmp_field() which causes a memory overrun in queries that uses "ORDER BY constant_expression" Added optimisation for ORDER BY NULL
Diffstat (limited to 'mysys/my_os2mutex.c')
-rw-r--r--mysys/my_os2mutex.c53
1 files changed, 19 insertions, 34 deletions
diff --git a/mysys/my_os2mutex.c b/mysys/my_os2mutex.c
index 718aa9f2932..5010d6e8dd5 100644
--- a/mysys/my_os2mutex.c
+++ b/mysys/my_os2mutex.c
@@ -36,63 +36,48 @@
#include <stdlib.h>
#include <errno.h>
#ifdef _THREAD_SAFE
-//#include <pthread.h>
-//#include "pthread_private.h"
int
pthread_mutex_init(pthread_mutex_t * mutex,
const pthread_mutexattr_t * mutex_attr)
{
- APIRET rc = 0;
-
- rc = DosCreateMutexSem(NULL,mutex,0,0);
-
- /* Return the completion status: */
- return (0);
+ (void) DosCreateMutexSem(NULL,mutex,0,0);
+ return (0); /* Return the completion status: */
}
+
int
pthread_mutex_destroy(pthread_mutex_t * mutex)
{
- APIRET rc = 0;
-
+ APIRET rc;
- do {
- rc = DosCloseMutexSem(*mutex);
- if (rc == 301) DosReleaseMutexSem(*mutex);
- } while (rc == 301);
+ do
+ {
+ rc = DosCloseMutexSem(*mutex);
+ if (rc == 301) DosReleaseMutexSem(*mutex);
+ } while (rc == 301);
- *mutex = 0;
-
- /* Return the completion status: */
- return (0);
+ *mutex = 0;
+ return (0); /* Return the completion status: */
}
int
pthread_mutex_lock(pthread_mutex_t * mutex)
{
- int ret = 0;
- int status = 0;
- APIRET rc = 0;
+ APIRET rc;
- rc = DosRequestMutexSem(*mutex,SEM_INDEFINITE_WAIT);
- if (rc)
- return(EINVAL);
- /* Return the completion status: */
- return (0);
+ rc = DosRequestMutexSem(*mutex,SEM_INDEFINITE_WAIT);
+ if (rc)
+ return(EINVAL);
+ return (0); /* Return the completion status: */
}
+
int
pthread_mutex_unlock(pthread_mutex_t * mutex)
{
- int ret = 0;
- APIRET rc = 0;
- int status;
-
- rc = DosReleaseMutexSem(*mutex);
-
- /* Return the completion status: */
- return (0);
+ (void) DosReleaseMutexSem(*mutex);
+ return (0); /* Return the completion status: */
}
#endif