diff options
| author | Dirk Engling <erdgeist@erdgeist.org> | 2026-10-31 18:48:00 +0100 |
|---|---|---|
| committer | Dirk Engling <erdgeist@erdgeist.org> | 2026-10-31 18:48:00 +0100 |
| commit | 5b25f89d00433f1c11576d1ea19304797dc60d1b (patch) | |
| tree | 3810c8585354f4795bd2f441b64f70e581855214 /ot_stats.c | |
| parent | 0bd368691eb0d9051725d76b2a3721bb902c919b (diff) | |
Refactor ot_workqueue out of ot_mutex, no behaviour change
Diffstat (limited to 'ot_stats.c')
| -rw-r--r-- | ot_stats.c | 9 |
1 files changed, 5 insertions, 4 deletions
| @@ -23,6 +23,7 @@ | |||
| 23 | #include "ot_iovec.h" | 23 | #include "ot_iovec.h" |
| 24 | #include "ot_ip.h" | 24 | #include "ot_ip.h" |
| 25 | #include "ot_mutex.h" | 25 | #include "ot_mutex.h" |
| 26 | #include "ot_workqueue.h" | ||
| 26 | #include "ot_fmt.h" | 27 | #include "ot_fmt.h" |
| 27 | #include "ot_stats.h" | 28 | #include "ot_stats.h" |
| 28 | #include "trackerlogic.h" | 29 | #include "trackerlogic.h" |
| @@ -803,17 +804,17 @@ static void *stats_worker(void *args) { | |||
| 803 | 804 | ||
| 804 | while (g_opentracker_running) { | 805 | while (g_opentracker_running) { |
| 805 | ot_tasktype tasktype = TASK_STATS; | 806 | ot_tasktype tasktype = TASK_STATS; |
| 806 | ot_taskid taskid = mutex_workqueue_poptask(&tasktype); | 807 | ot_taskid taskid = workqueue_poptask(&tasktype); |
| 807 | if (!taskid) | 808 | if (!taskid) |
| 808 | break; | 809 | break; |
| 809 | stats_make(&iovec_entries, &iovector, tasktype); | 810 | stats_make(&iovec_entries, &iovector, tasktype); |
| 810 | if (mutex_workqueue_pushresult(taskid, iovec_entries, iovector)) | 811 | if (workqueue_pushresult(taskid, iovec_entries, iovector)) |
| 811 | iovec_free(&iovec_entries, &iovector); | 812 | iovec_free(&iovec_entries, &iovector); |
| 812 | } | 813 | } |
| 813 | return NULL; | 814 | return NULL; |
| 814 | } | 815 | } |
| 815 | 816 | ||
| 816 | void stats_deliver(int64_t sock, int tasktype) { mutex_workqueue_pushtask(sock, tasktype); } | 817 | void stats_deliver(int64_t sock, int tasktype) { workqueue_pushtask(sock, tasktype); } |
| 817 | 818 | ||
| 818 | static pthread_t thread_id; | 819 | static pthread_t thread_id; |
| 819 | void stats_init(void) { | 820 | void stats_init(void) { |
| @@ -822,6 +823,6 @@ void stats_init(void) { | |||
| 822 | } | 823 | } |
| 823 | 824 | ||
| 824 | void stats_deinit(void) { | 825 | void stats_deinit(void) { |
| 825 | mutex_workqueue_wakeall(); | 826 | workqueue_wakeall(); |
| 826 | pthread_join(thread_id, NULL); | 827 | pthread_join(thread_id, NULL); |
| 827 | } | 828 | } |
