summaryrefslogtreecommitdiff
path: root/src/common/db.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/db.h')
-rw-r--r--src/common/db.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/common/db.h b/src/common/db.h
index c31f5bfaa..11ed4f3e1 100644
--- a/src/common/db.h
+++ b/src/common/db.h
@@ -13,6 +13,7 @@ struct dbn {
int color;
void *key;
void *data;
+ int deleted; // 削除済みフラグ(db_foreach)
};
struct dbt {
@@ -24,7 +25,16 @@ struct dbt {
struct dbn *ht[HASH_SIZE];
int item_count; // vf?
const char* alloc_file; // DB?t@C
- int alloc_line; // DB?s
+ int alloc_line; // DB?s
+ // db_foreach 内部でdb_erase される対策として、
+ // db_foreach が終わるまでロックすることにする
+ struct db_free {
+ struct dbn *z;
+ struct dbn **root;
+ } *free_list;
+ int free_count;
+ int free_max;
+ int free_lock;
};
#define strdb_search(t,k) db_search((t),(void*)(k))