summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
Diffstat (limited to 'mysys')
-rw-r--r--mysys/thr_mutex.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/mysys/thr_mutex.c b/mysys/thr_mutex.c
index 149a30a4b24..7cc3b30aaf9 100644
--- a/mysys/thr_mutex.c
+++ b/mysys/thr_mutex.c
@@ -219,7 +219,7 @@ int safe_cond_timedwait(pthread_cond_t *cond, safe_mutex_t *mp,
int safe_mutex_destroy(safe_mutex_t *mp, const char *file, uint line)
{
- int error;
+ int error=0;
if (mp->count != 0)
{
fprintf(stderr,"safe_mutex: Trying to destroy a mutex that was locked at %s, line %d at %s, line %d\n",
@@ -228,12 +228,13 @@ int safe_mutex_destroy(safe_mutex_t *mp, const char *file, uint line)
abort();
}
#ifdef __WIN__
- error=0;
pthread_mutex_destroy(&mp->global);
pthread_mutex_destroy(&mp->mutex);
#else
- error= (int) (pthread_mutex_destroy(&mp->global) ||
- pthread_mutex_destroy(&mp->mutex));
+ if (pthread_mutex_destroy(&mp->global))
+ error=1;
+ if (pthread_mutex_destroy(&mp->mutex))
+ error=1;
#endif
return error;
}