summaryrefslogtreecommitdiffstats
path: root/Alc/backends/alsa.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2013-10-27 08:14:13 -0700
committerChris Robinson <[email protected]>2013-10-27 08:14:13 -0700
commit8ceb800defbf13354866cd7c6a4b676cf54aad5d (patch)
treee46b00b1fe38403173b28566cbcb2d421a4d9ca9 /Alc/backends/alsa.c
parentb9e30f76041a029e9d4cd58f6c87086c0b527d6d (diff)
Rework threading functions
Diffstat (limited to 'Alc/backends/alsa.c')
-rw-r--r--Alc/backends/alsa.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/Alc/backends/alsa.c b/Alc/backends/alsa.c
index bb30dac5..c60187fa 100644
--- a/Alc/backends/alsa.c
+++ b/Alc/backends/alsa.c
@@ -26,6 +26,7 @@
#include "alMain.h"
#include "alu.h"
+#include "threads.h"
#include <alsa/asoundlib.h>
@@ -293,7 +294,7 @@ typedef struct {
snd_pcm_sframes_t last_avail;
volatile int killNow;
- ALvoid *thread;
+ althread_t thread;
} alsa_data;
typedef struct {
@@ -849,6 +850,7 @@ error:
static ALCboolean alsa_start_playback(ALCdevice *device)
{
alsa_data *data = (alsa_data*)device->ExtraData;
+ ALuint (*thread_func)(ALvoid*) = NULL;
snd_pcm_hw_params_t *hp = NULL;
snd_pcm_access_t access;
const char *funcerr;
@@ -872,7 +874,7 @@ static ALCboolean alsa_start_playback(ALCdevice *device)
ERR("buffer malloc failed\n");
return ALC_FALSE;
}
- data->thread = StartThread(ALSANoMMapProc, device);
+ thread_func = ALSANoMMapProc;
}
else
{
@@ -882,9 +884,9 @@ static ALCboolean alsa_start_playback(ALCdevice *device)
ERR("snd_pcm_prepare(data->pcmHandle) failed: %s\n", snd_strerror(err));
return ALC_FALSE;
}
- data->thread = StartThread(ALSAProc, device);
+ thread_func = ALSAProc;
}
- if(data->thread == NULL)
+ if(!StartThread(&data->thread, thread_func, device))
{
ERR("Could not create playback thread\n");
free(data->buffer);