# HG changeset patch # User Olaf Wintermann # Date 1765101107 -3600 # Node ID ea9a999b4fc887fccb0982b62b6fa830b120ce20 # Parent 07c1effb2a31fb47939ee78168f3e3a9b6fbe2b5 implement ui_queue_free diff -r 07c1effb2a31 -r ea9a999b4fc8 application/main.c --- a/application/main.c Sun Dec 07 10:41:04 2025 +0100 +++ b/application/main.c Sun Dec 07 10:51:47 2025 +0100 @@ -213,6 +213,8 @@ static int thr_end = 0; static int thr_started = 0; +static UiThreadpool *threadpool; + int threadfunc(void *data) { printf("thr wait for data...\n"); ui_condvar_wait(cond); @@ -900,6 +902,8 @@ ui_toolbar_add_default("Test4", UI_TOOLBAR_RIGHT); ui_toolbar_add_default("Test5", UI_TOOLBAR_RIGHT); + threadpool = ui_threadpool_create(10); + ui_main(); return (EXIT_SUCCESS); diff -r 07c1effb2a31 -r ea9a999b4fc8 ui/common/threadpool.c --- a/ui/common/threadpool.c Sun Dec 07 10:41:04 2025 +0100 +++ b/ui/common/threadpool.c Sun Dec 07 10:51:47 2025 +0100 @@ -156,7 +156,12 @@ } void ui_queue_free(UiQueue *queue) { - // TODO + // The queue must be empty, we could free UiQueueElm, + // but not the payload data + pthread_mutex_destroy(&queue->lock); + pthread_mutex_destroy(&queue->avlbl_lock); + pthread_cond_destroy(&queue->available); + free(queue); } void ui_queue_put(UiQueue *queue, void *data) {