From 8e676db633aa8888c8408a91ef219d2261ef42e2 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 17 Oct 2013 18:42:14 +0200 Subject: Thread/Thread: replacement library for GThread --- src/OutputControl.cxx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/OutputControl.cxx') diff --git a/src/OutputControl.cxx b/src/OutputControl.cxx index 3dc9c470b..4a3552c17 100644 --- a/src/OutputControl.cxx +++ b/src/OutputControl.cxx @@ -107,7 +107,7 @@ audio_output_set_replay_gain_mode(struct audio_output *ao, void audio_output_enable(struct audio_output *ao) { - if (ao->thread == NULL) { + if (!ao->thread.IsDefined()) { if (ao->plugin->enable == NULL) { /* don't bother to start the thread now if the device doesn't even have a enable() method; @@ -125,7 +125,7 @@ audio_output_enable(struct audio_output *ao) void audio_output_disable(struct audio_output *ao) { - if (ao->thread == NULL) { + if (!ao->thread.IsDefined()) { if (ao->plugin->disable == NULL) ao->really_enabled = false; else @@ -184,7 +184,7 @@ audio_output_open(struct audio_output *ao, ao->pipe = ∓ - if (ao->thread == NULL) + if (!ao->thread.IsDefined()) audio_output_thread_start(ao); ao_command(ao, ao->open ? AO_COMMAND_REOPEN : AO_COMMAND_OPEN); @@ -322,11 +322,10 @@ void audio_output_finish(struct audio_output *ao) assert(ao->fail_timer == NULL); - if (ao->thread != NULL) { + if (ao->thread.IsDefined()) { assert(ao->allow_play); ao_lock_command(ao, AO_COMMAND_KILL); - g_thread_join(ao->thread); - ao->thread = NULL; + ao->thread.Join(); } audio_output_free(ao); -- cgit v1.2.3