event/Thread: start the thread in the constructor
This is the proper fix for thee309941646
regression; see commitabc8420697
This commit is contained in:
@@ -329,9 +329,6 @@ MainConfigured(const CommandLineOptions &options,
|
||||
Instance instance;
|
||||
global_instance = &instance;
|
||||
|
||||
instance.io_thread.Start();
|
||||
instance.rtio_thread.Start();
|
||||
|
||||
#ifdef ENABLE_NEIGHBOR_PLUGINS
|
||||
instance.neighbors = std::make_unique<NeighborGlue>();
|
||||
instance.neighbors->Init(raw_config,
|
||||
|
@@ -20,7 +20,9 @@ class EventThread final {
|
||||
public:
|
||||
explicit EventThread(bool _realtime=false)
|
||||
:event_loop(ThreadId::Null()), thread(BIND_THIS_METHOD(Run)),
|
||||
realtime(_realtime) {}
|
||||
realtime(_realtime) {
|
||||
Start();
|
||||
}
|
||||
|
||||
~EventThread() noexcept {
|
||||
Stop();
|
||||
@@ -30,11 +32,11 @@ public:
|
||||
return event_loop;
|
||||
}
|
||||
|
||||
private:
|
||||
void Start();
|
||||
|
||||
void Stop() noexcept;
|
||||
|
||||
private:
|
||||
void Run() noexcept;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user