summaryrefslogtreecommitdiff
path: root/mysys/my_bitmap.c
diff options
context:
space:
mode:
authorMagne Mahre <magne.mahre@oracle.com>2011-01-11 10:07:37 +0100
committerMagne Mahre <magne.mahre@oracle.com>2011-01-11 10:07:37 +0100
commit8ede0759c30bb49025b466a69951d5f36d2b6b92 (patch)
tree5aa89e155e701ad4709cbd1e6a9efc5b5f1bb755 /mysys/my_bitmap.c
parent5511a9d7ba6e60cfff30ae414155e8aba6e3d30a (diff)
downloadmariadb-git-8ede0759c30bb49025b466a69951d5f36d2b6b92.tar.gz
Remove configuration preprocessor symbols 'THREAD'
and 'THREAD_SAFE_CLIENT'. As of MySQL 5.5, we no longer support non-threaded builds. This patch removes all references to the obsolete THREAD and THREAD_SAFE_CLIENT preprocessor symbols. These were used to distinguish between threaded and non-threaded builds.
Diffstat (limited to 'mysys/my_bitmap.c')
-rw-r--r--mysys/my_bitmap.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/mysys/my_bitmap.c b/mysys/my_bitmap.c
index 3401c7301e9..dc15014121b 100644
--- a/mysys/my_bitmap.c
+++ b/mysys/my_bitmap.c
@@ -22,9 +22,6 @@
* the internal size is a set of 32 bit words
* the number of bits specified in creation can be any number > 0
* there are THREAD safe versions of most calls called bitmap_lock_*
- many of those are not used and not compiled normally but the code
- already exist for them in an #ifdef:ed part. These can only be used
- if THREAD was specified in bitmap_init
TODO:
Make assembler THREAD safe versions of these using test-and-set instructions
@@ -85,18 +82,14 @@ void create_last_word_mask(MY_BITMAP *map)
static inline void bitmap_lock(MY_BITMAP *map __attribute__((unused)))
{
-#ifdef THREAD
if (map->mutex)
mysql_mutex_lock(map->mutex);
-#endif
}
static inline void bitmap_unlock(MY_BITMAP *map __attribute__((unused)))
{
-#ifdef THREAD
if (map->mutex)
mysql_mutex_unlock(map->mutex);
-#endif
}
@@ -108,30 +101,30 @@ my_bool bitmap_init(MY_BITMAP *map, my_bitmap_map *buf, uint n_bits,
{
uint size_in_bytes= bitmap_buffer_size(n_bits);
uint extra= 0;
-#ifdef THREAD
+
if (thread_safe)
{
size_in_bytes= ALIGN_SIZE(size_in_bytes);
extra= sizeof(mysql_mutex_t);
}
map->mutex= 0;
-#endif
+
if (!(buf= (my_bitmap_map*) my_malloc(size_in_bytes+extra, MYF(MY_WME))))
DBUG_RETURN(1);
-#ifdef THREAD
+
if (thread_safe)
{
map->mutex= (mysql_mutex_t *) ((char*) buf + size_in_bytes);
mysql_mutex_init(key_BITMAP_mutex, map->mutex, MY_MUTEX_INIT_FAST);
}
-#endif
+
}
-#ifdef THREAD
+
else
{
DBUG_ASSERT(thread_safe == 0);
}
-#endif
+
map->bitmap= buf;
map->n_bits= n_bits;
@@ -146,10 +139,9 @@ void bitmap_free(MY_BITMAP *map)
DBUG_ENTER("bitmap_free");
if (map->bitmap)
{
-#ifdef THREAD
if (map->mutex)
mysql_mutex_destroy(map->mutex);
-#endif
+
my_free(map->bitmap);
map->bitmap=0;
}