diff options
Diffstat (limited to 'src/analysis')
-rw-r--r-- | src/analysis/db/collection.c | 9 | ||||
-rw-r--r-- | src/analysis/db/collection.h | 9 |
2 files changed, 4 insertions, 14 deletions
diff --git a/src/analysis/db/collection.c b/src/analysis/db/collection.c index ce2d580..da48d3a 100644 --- a/src/analysis/db/collection.c +++ b/src/analysis/db/collection.c @@ -673,7 +673,6 @@ static void g_db_collection_set_last_item(GDbCollection *collec, GDbItem *item, * * * Paramètres : collec = ensemble d'éléments à considérer. * * item = élément de collection à manipuler. * -* lock = indique si le verrou d'écriture doit être posé. * * * * Description : Procède à l'ajout d'un nouvel élément dans la collection. * * * @@ -683,14 +682,13 @@ static void g_db_collection_set_last_item(GDbCollection *collec, GDbItem *item, * * ******************************************************************************/ -bool _g_db_collection_add_item(GDbCollection *collec, GDbItem *item, bool lock) +bool g_db_collection_add_item(GDbCollection *collec, GDbItem *item) { bool result; /* Bilan à faire remonter */ result = true; - if (lock) - g_db_collection_wlock(collec); + g_db_collection_wlock(collec); collec->items = realloc(collec->items, ++collec->count * sizeof(GDbItem *)); collec->items[collec->count - 1] = item; @@ -699,8 +697,7 @@ bool _g_db_collection_add_item(GDbCollection *collec, GDbItem *item, bool lock) g_signal_emit_by_name(collec, "content-extended", item); - if (lock) - g_db_collection_wunlock(collec); + g_db_collection_wunlock(collec); return result; diff --git a/src/analysis/db/collection.h b/src/analysis/db/collection.h index 1822a36..5c62aef 100644 --- a/src/analysis/db/collection.h +++ b/src/analysis/db/collection.h @@ -96,7 +96,7 @@ void g_db_collection_lock_unlock(GDbCollection *, bool, bool); GDbItem **g_db_collection_get_items(const GDbCollection *, size_t *); /* Procède à l'ajout d'un nouvel élément dans la collection. */ -bool _g_db_collection_add_item(GDbCollection *, GDbItem *, bool); +bool g_db_collection_add_item(GDbCollection *, GDbItem *); /* Procède au retrait des éléments désactivés de la collection. */ bool g_db_collection_drop_disabled_items(GDbCollection *, packed_buffer *); @@ -112,13 +112,6 @@ bool g_db_collection_update_item_state(GDbCollection *, const GDbItem *); - - -#define g_db_collection_add_item(c, i) _g_db_collection_add_item(c, i, true) -//#define g_db_collection_remove_item(c, i) _g_db_collection_remove_item(c, i, true, true) - - - /* --------------------- MANIPULATIONS AVEC UNE BASE DE DONNEES --------------------- */ |