From 69d33636bf857da08e63a1ba00b46f30af428f2c Mon Sep 17 00:00:00 2001 From: jeka Date: Thu, 5 Mar 2026 15:05:20 +0300 Subject: [PATCH] 1 --- lib/ll_queue.c | 11 +++++++++-- lib/ll_queue.h | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/ll_queue.c b/lib/ll_queue.c index 4df6989..dc87068 100644 --- a/lib/ll_queue.c +++ b/lib/ll_queue.c @@ -262,7 +262,9 @@ int queue_data_put(struct ll_queue* q, struct ll_entry* entry, uint32_t id) { // Проверить ожидающие коллбэки check_waiters(q); +#ifdef QUEUE_DEBUG queue_check_consistency(q);// !!!! for debug +#endif return 0; } @@ -303,7 +305,9 @@ int queue_data_put_first(struct ll_queue* q, struct ll_entry* entry, uint32_t id // Проверить ожидающие коллбэки check_waiters(q); +#ifdef QUEUE_DEBUG queue_check_consistency(q);// !!!! for debug +#endif return 0; } @@ -332,7 +336,9 @@ struct ll_entry* queue_data_get(struct ll_queue* q) { // Проверить ожидающие коллбэки check_waiters(q); +#ifdef QUEUE_DEBUG queue_check_consistency(q);// !!!! for debug +#endif return entry; } @@ -450,7 +456,8 @@ int queue_remove_data(struct ll_queue* q, struct ll_entry* entry) { remove_from_hash(q, entry); // DEBUG_DEBUG(DEBUG_CATEGORY_LL_QUEUE, "queue_remove_data: removed entry %p (id=%u), count=%d", entry, entry->id, q->count); +#ifdef QUEUE_DEBUG queue_check_consistency(q);// !!!! for debug - +#endif return 0; -} \ No newline at end of file +} diff --git a/lib/ll_queue.h b/lib/ll_queue.h index a1863d8..4ce7fd8 100644 --- a/lib/ll_queue.h +++ b/lib/ll_queue.h @@ -5,6 +5,8 @@ #include // для uint64_t #include "memory_pool.h" // для struct memory_pool +#define QUEUE_DEBUG 1 + /** * @file ll_queue.h * @brief Упрощённая двусвязная очередь с поддержкой автозабора элементов через callback,