проверки thread в ll_queue

This commit is contained in:
jeka committed 2026-03-06 22:45:00 +03:00
1 parent 1811764f6d
commit 5dfd1ea5fe
5 files changed
+85 -6

No files matched your search

+16
View File
@@ -5,7 +5,14 @@
#include <stdint.h> // для uint64_t
#include "memory_pool.h" // для struct memory_pool
#ifdef _WIN32
#include <windows.h>
#else
#include <pthread.h>
#endif
#define QUEUE_DEBUG 1
#define QUEUE_THREAD_CHECK 1 // 0 to disable
/**
* @file ll_queue.h
@@ -45,6 +52,7 @@ struct ll_queue;
* Поле dgram — отдельный блок (malloc / пул / внешняя память).
*/
struct ll_entry {
char* name;
struct ll_entry* next; ///< Следующий элемент в очереди
struct ll_entry* prev; ///< Предыдущий элемент в очереди
uint16_t size; ///< Размер пользовательского буфера data[] (байт)
@@ -115,6 +123,14 @@ struct ll_queue {
struct ll_entry** hash_table; ///< Хеш-таблица для поиска по id (если hash_size > 0)
size_t hash_size; ///< Размер хеш-таблицы
#ifdef QUEUE_THREAD_CHECK
#ifdef _WIN32
DWORD owner_thread;
#else
pthread_t owner_thread;
#endif
#endif
};
/* ==================== Создание / уничтожение ==================== */