Main: start IO threads before initializing the rest
This fixes a regression triggered by commit e309941646
-
IORING_SETUP_SINGLE_ISSUER broke because io_uring_setup() was called
fromm the main thread, yet io_uring_submit() in the I/O thread. This
is because the I/O thread was not yet started when
InitUringInputPlugin() was called, and BlockingCall() was invoked
synchronously in the main thread. This has always been wrong, but was
never noticed.
This commit is contained in:
@ -329,6 +329,9 @@ MainConfigured(const CommandLineOptions &options,
|
|||||||
Instance instance;
|
Instance instance;
|
||||||
global_instance = &instance;
|
global_instance = &instance;
|
||||||
|
|
||||||
|
instance.io_thread.Start();
|
||||||
|
instance.rtio_thread.Start();
|
||||||
|
|
||||||
#ifdef ENABLE_NEIGHBOR_PLUGINS
|
#ifdef ENABLE_NEIGHBOR_PLUGINS
|
||||||
instance.neighbors = std::make_unique<NeighborGlue>();
|
instance.neighbors = std::make_unique<NeighborGlue>();
|
||||||
instance.neighbors->Init(raw_config,
|
instance.neighbors->Init(raw_config,
|
||||||
@ -421,9 +424,6 @@ MainConfigured(const CommandLineOptions &options,
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
instance.io_thread.Start();
|
|
||||||
instance.rtio_thread.Start();
|
|
||||||
|
|
||||||
#ifdef ENABLE_NEIGHBOR_PLUGINS
|
#ifdef ENABLE_NEIGHBOR_PLUGINS
|
||||||
if (instance.neighbors != nullptr)
|
if (instance.neighbors != nullptr)
|
||||||
instance.neighbors->Open();
|
instance.neighbors->Open();
|
||||||
|
Reference in New Issue
Block a user