summaryrefslogtreecommitdiff
path: root/mysys/my_bitmap.c
diff options
context:
space:
mode:
authorunknown <sasha@mysql.sashanet.com>2001-12-13 17:21:04 -0700
committerunknown <sasha@mysql.sashanet.com>2001-12-13 17:21:04 -0700
commit601b545eed9404ee3718537887464e7b37a9d7bf (patch)
tree3f8b7cec7cee300f00423ae447fa93847a222d55 /mysys/my_bitmap.c
parent961f7be52fa7b4c5f2c3775eef2467b3a441d97a (diff)
downloadmariadb-git-601b545eed9404ee3718537887464e7b37a9d7bf.tar.gz
misc cleanup
Docs/manual.texi: fixed bad merge include/my_bitmap.h: fixed comment format mysql-test/r/rpl_get_lock.result: make the test results predicable mysql-test/t/rpl_get_lock.test: predicatable test results mysys/my_bitmap.c: do not init/destroy mutex if bitmap is not declared thread safe sql/slave.cc: clean-up suggested by Monty to make init_slave_skip_errors() more compact
Diffstat (limited to 'mysys/my_bitmap.c')
-rw-r--r--mysys/my_bitmap.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/mysys/my_bitmap.c b/mysys/my_bitmap.c
index ba0a5df95c6..6bab35eabb1 100644
--- a/mysys/my_bitmap.c
+++ b/mysys/my_bitmap.c
@@ -51,8 +51,8 @@ my_bool bitmap_init(MY_BITMAP *map, uint bitmap_size, my_bool thread_safe)
return 1;
dbug_assert(bitmap_size != ~(uint) 0);
#ifdef THREAD
- map->thread_safe = thread_safe;
- pthread_mutex_init(&map->mutex, MY_MUTEX_INIT_FAST);
+ if ((map->thread_safe = thread_safe))
+ pthread_mutex_init(&map->mutex, MY_MUTEX_INIT_FAST);
#endif
map->bitmap_size=bitmap_size;
return 0;
@@ -65,7 +65,8 @@ void bitmap_free(MY_BITMAP *map)
my_free((char*) map->bitmap, MYF(0));
map->bitmap=0;
#ifdef THREAD
- pthread_mutex_destroy(&map->mutex);
+ if (map->thread_safe)
+ pthread_mutex_destroy(&map->mutex);
#endif
}
}