summaryrefslogtreecommitdiff
path: root/infra/stellar_core.c
diff options
context:
space:
mode:
authoryangwei <[email protected]>2024-09-27 09:15:26 +0800
committeryangwei <[email protected]>2024-09-27 09:15:26 +0800
commit7aeb5949ee545fd7ab8316618c53769e12715098 (patch)
treef77a15c148d8b3aef815a7bb918bd96f6375bd05 /infra/stellar_core.c
parentb3769f0b9f75581af79f6e2fd332beaee6a7336e (diff)
✨ feat(polling in stellar core): worker thread call polling_dispatch
Diffstat (limited to 'infra/stellar_core.c')
-rw-r--r--infra/stellar_core.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/infra/stellar_core.c b/infra/stellar_core.c
index 49a3546..8574fd1 100644
--- a/infra/stellar_core.c
+++ b/infra/stellar_core.c
@@ -7,6 +7,7 @@
#include "packet_manager_internal.h"
#include "stellar/stellar.h"
#include "stellar/module_manager.h"
+#include "polling_manager_internal.h"
#define CORE_LOG_FATAL(format, ...) STELLAR_LOG_FATAL(__thread_local_logger, "core", format, ##__VA_ARGS__)
#define CORE_LOG_ERROR(format, ...) STELLAR_LOG_ERROR(__thread_local_logger, "core", format, ##__VA_ARGS__)
@@ -51,6 +52,9 @@ static void *worker_thread(void *arg)
struct packet_manager *pkt_mgr = st->pkt_mgr;
struct stellar_module_manager *mod_mgr = st->mod_mgr;
struct mq_runtime *mq_rt = mq_runtime_new(st->mq_schema);
+ struct stellar_polling_manager *polling_mgr=stellar_module_get_polling_manager(mod_mgr);
+
+
snprintf(thread_name, sizeof(thread_name), "stellar:%d", thread_id);
prctl(PR_SET_NAME, (unsigned long long)thread_name, NULL, NULL, NULL);
@@ -102,12 +106,11 @@ static void *worker_thread(void *arg)
{
packet_io_egress(pkt_io, thread_id, pkt, 1);
}
-
- // TODO polling
+ stellar_polling_dispatch(polling_mgr);
}
idle_tasks:
- // TODO polling
+ stellar_polling_dispatch(polling_mgr);
if (nr_pkt_rcv == 0)
{