Browse Source

1

nodeinfo-routing-update
jeka 4 weeks ago
parent
commit
69d33636bf
  1. 11
      lib/ll_queue.c
  2. 2
      lib/ll_queue.h

11
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;
}
}

2
lib/ll_queue.h

@ -5,6 +5,8 @@
#include <stdint.h> // для uint64_t
#include "memory_pool.h" // для struct memory_pool
#define QUEUE_DEBUG 1
/**
* @file ll_queue.h
* @brief Упрощённая двусвязная очередь с поддержкой автозабора элементов через callback,

Loading…
Cancel
Save