summaryrefslogtreecommitdiff
path: root/include/my_bitmap.h
diff options
context:
space:
mode:
authormonty@hundin.mysql.fi <>2001-12-15 05:12:21 +0200
committermonty@hundin.mysql.fi <>2001-12-15 05:12:21 +0200
commit836f1608f743bc15fda737bb769f375d72fb225f (patch)
tree5b07ad850f8dba78d186135337dd5a151d18a2b8 /include/my_bitmap.h
parent3b95f2570f8416b11679df72c9889c7bb17de16f (diff)
parentee9a6f54600dcb182243daa126eb4aeb7fd82308 (diff)
downloadmariadb-git-836f1608f743bc15fda737bb769f375d72fb225f.tar.gz
Merge with 3.23.47
Diffstat (limited to 'include/my_bitmap.h')
-rw-r--r--include/my_bitmap.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/include/my_bitmap.h b/include/my_bitmap.h
index 11df10f26a1..ca0037addfb 100644
--- a/include/my_bitmap.h
+++ b/include/my_bitmap.h
@@ -25,6 +25,12 @@ typedef struct st_bitmap
{
uchar *bitmap;
uint bitmap_size;
+ my_bool thread_safe; /* set if several threads access the bitmap */
+ /*
+ mutex will be acquired for the duration of each bitmap operation if
+ thread_safe flag is set. Otherwise, we optimize by not acquiring the
+ mutex
+ */
#ifdef THREAD
pthread_mutex_t mutex;
#endif
@@ -33,10 +39,14 @@ typedef struct st_bitmap
#ifdef __cplusplus
extern "C" {
#endif
- extern my_bool bitmap_init(MY_BITMAP *bitmap, uint bitmap_size);
+ extern my_bool bitmap_init(MY_BITMAP *bitmap, uint bitmap_size,
+ my_bool thread_safe);
extern void bitmap_free(MY_BITMAP *bitmap);
extern void bitmap_set_bit(MY_BITMAP *bitmap, uint bitmap_bit);
extern uint bitmap_set_next(MY_BITMAP *bitmap);
+ extern void bitmap_set_all(MY_BITMAP* bitmap);
+ extern my_bool bitmap_is_set(MY_BITMAP* bitmap, uint bitmap_bit);
+ extern void bitmap_clear_all(MY_BITMAP* bitmap);
extern void bitmap_clear_bit(MY_BITMAP *bitmap, uint bitmap_bit);
#ifdef __cplusplus
}