summaryrefslogtreecommitdiff
path: root/mysys/thr_mutex.c
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2003-11-21 14:41:57 +0200
committerunknown <monty@mysql.com>2003-11-21 14:41:57 +0200
commit52521cc8c76f99d2046a72a09440e616797e672a (patch)
tree1dae851e03d54c7a8de1e73a27a50426cef61563 /mysys/thr_mutex.c
parenteaae71470800fd12db6f4c0583a70e6f6eb722ae (diff)
downloadmariadb-git-52521cc8c76f99d2046a72a09440e616797e672a.tar.gz
Fixed memory leak with RAID tables
Fixed tests for RAID tables Detect uninitialized mutexes on lock and destroy mysql-test/r/raid.result: Updated results mysql-test/r/rpl_change_master.result: Update results missing from last patch mysql-test/t/raid.test: Clean up test mysys/mf_iocache.c: Comments Small safety fix mysys/thr_mutex.c: Detect uninitialized mutexes on lock and destroy sql/sql_db.cc: Fixed memory leak with RAID tables
Diffstat (limited to 'mysys/thr_mutex.c')
-rw-r--r--mysys/thr_mutex.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/mysys/thr_mutex.c b/mysys/thr_mutex.c
index 474334efcc0..8ebe5be22e8 100644
--- a/mysys/thr_mutex.c
+++ b/mysys/thr_mutex.c
@@ -97,10 +97,12 @@ int safe_mutex_lock(safe_mutex_t *mp,const char *file, uint line)
int error;
if (!mp->file)
{
- fprintf(stderr,"safe_mutex: Trying to lock unitialized mutex at %s, line %d", file, line);
+ fprintf(stderr,
+ "safe_mutex: Trying to lock unitialized mutex at %s, line %d\n",
+ file, line);
fflush(stderr);
abort();
- }
+ }
pthread_mutex_lock(&mp->global);
if (mp->count > 0 && pthread_equal(pthread_self(),mp->thread))
@@ -262,6 +264,14 @@ 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=0;
+ if (!mp->file)
+ {
+ fprintf(stderr,
+ "safe_mutex: Trying to destroy unitialized mutex at %s, line %d\n",
+ file, line);
+ fflush(stderr);
+ abort();
+ }
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",