Skip to content

Commit b49cfe9

Browse files
committed
event/Thread: start the thread in the constructor
This is the proper fix for the e309941 regression; see commit abc8420
1 parent ae112fe commit b49cfe9

File tree

13 files changed

+4
-22
lines changed

13 files changed

+4
-22
lines changed

src/Main.cxx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -329,9 +329,6 @@ MainConfigured(const CommandLineOptions &options,
329329
Instance instance;
330330
global_instance = &instance;
331331

332-
instance.io_thread.Start();
333-
instance.rtio_thread.Start();
334-
335332
#ifdef ENABLE_NEIGHBOR_PLUGINS
336333
instance.neighbors = std::make_unique<NeighborGlue>();
337334
instance.neighbors->Init(raw_config,

src/event/Thread.hxx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ class EventThread final {
2020
public:
2121
explicit EventThread(bool _realtime=false)
2222
:event_loop(ThreadId::Null()), thread(BIND_THIS_METHOD(Run)),
23-
realtime(_realtime) {}
23+
realtime(_realtime) {
24+
Start();
25+
}
2426

2527
~EventThread() noexcept {
2628
Stop();
@@ -30,11 +32,11 @@ public:
3032
return event_loop;
3133
}
3234

35+
private:
3336
void Start();
3437

3538
void Stop() noexcept;
3639

37-
private:
3840
void Run() noexcept;
3941
};
4042

test/DumpDatabase.cxx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,6 @@ class GlobalInit {
2828
EventThread io_thread;
2929

3030
public:
31-
GlobalInit() {
32-
io_thread.Start();
33-
}
34-
35-
~GlobalInit() = default;
36-
3731
EventLoop &GetEventLoop() {
3832
return io_thread.GetEventLoop();
3933
}

test/DumpOgg.cxx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ try {
2424
const char *path = argv[1];
2525

2626
EventThread io_thread;
27-
io_thread.Start();
2827

2928
const ScopeInputPluginsInit input_plugins_init(ConfigData(),
3029
io_thread.GetEventLoop());

test/RunChromaprint.cxx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ class GlobalInit {
8484
input_plugins_init(config, io_thread.GetEventLoop()),
8585
decoder_plugins_init(config)
8686
{
87-
io_thread.Start();
88-
8987
pcm_convert_global_init(config);
9088
}
9189
};

test/dump_playlist.cxx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ try {
4747
const auto config = AutoLoadConfigFile(config_path);
4848

4949
EventThread io_thread;
50-
io_thread.Start();
5150

5251
const ScopeInputPluginsInit input_plugins_init(config, io_thread.GetEventLoop());
5352
const ScopePlaylistPluginsInit playlist_plugins_init(config);

test/dump_text_file.cxx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ class GlobalInit {
3434
explicit GlobalInit(Path config_path)
3535
:config(AutoLoadConfigFile(config_path))
3636
{
37-
io_thread.Start();
3837
}
3938
};
4039

test/read_tags.cxx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ try {
8686
const char *path = argv[2];
8787

8888
EventThread io_thread;
89-
io_thread.Start();
9089

9190
const ScopeInputPluginsInit input_plugins_init(ConfigData(),
9291
io_thread.GetEventLoop());

test/run_decoder.cxx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ class GlobalInit {
9191
input_plugins_init(config, io_thread.GetEventLoop()),
9292
decoder_plugins_init(config)
9393
{
94-
io_thread.Start();
9594
}
9695
};
9796

test/run_input.cxx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ class GlobalInit {
130130
explicit GlobalInit(Path config_path)
131131
:config(AutoLoadConfigFile(config_path))
132132
{
133-
io_thread.Start();
134133
}
135134
};
136135

0 commit comments

Comments
 (0)