Browse Source

wait for zalsa thread to finish

Signed-off-by: falkTX <falktx@falktx.com>
tags/v1.9.19
falkTX 4 years ago
parent
commit
1b3594e70f
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
3 changed files with 19 additions and 1 deletions
  1. +9
    -1
      tools/zalsa/alsathread.cc
  2. +9
    -0
      tools/zalsa/pxthread.cc
  3. +1
    -0
      tools/zalsa/pxthread.h

+ 9
- 1
tools/zalsa/alsathread.cc View File

@@ -45,7 +45,15 @@ Alsathread::Alsathread (Alsa_pcmi *alsadev, int mode) :

Alsathread::~Alsathread (void)
{
_alsadev->pcm_stop ();
if (_state != INIT)
{
_state = TERM;
thr_wait ();
}
else
{
_alsadev->pcm_stop ();
}
}




+ 9
- 0
tools/zalsa/pxthread.cc View File

@@ -76,3 +76,12 @@ void Pxthread::thr_main (void)
{
}


void Pxthread::thr_wait (void)
{
if (_thrid == 0)
return;
pthread_join (_thrid, NULL);
_thrid = 0;
}


+ 1
- 0
tools/zalsa/pxthread.h View File

@@ -42,6 +42,7 @@ public:

virtual void thr_main (void) = 0;
virtual int thr_start (int policy, int priority, size_t stacksize = 0);
virtual void thr_wait (void);

private:


Loading…
Cancel
Save