Thread/Thread: replacement library for GThread

This commit is contained in:
Max Kellermann
2013-10-17 18:42:14 +02:00
parent f6d74012b7
commit 8e676db633
21 changed files with 309 additions and 97 deletions

View File

@@ -27,8 +27,7 @@
#include <assert.h>
decoder_control::decoder_control()
:thread(nullptr),
state(DecoderState::STOP),
:state(DecoderState::STOP),
command(DecoderCommand::NONE),
song(nullptr),
replay_gain_db(0), replay_gain_prev_db(0),
@@ -124,13 +123,12 @@ decoder_control::Seek(double where)
void
decoder_control::Quit()
{
assert(thread != nullptr);
assert(thread.IsDefined());
quit = true;
LockAsynchronousCommand(DecoderCommand::STOP);
g_thread_join(thread);
thread = nullptr;
thread.Join();
}
void