@@ -88,7 +88,11 @@ Thread::run_thread ( void *arg ) | |||||
((Thread*)td.t)->_running = true; | ((Thread*)td.t)->_running = true; | ||||
return td.entry_point( td.arg ); | |||||
void * r = td.entry_point( td.arg ); | |||||
((Thread*)td.t)->_running = false; | |||||
return r; | |||||
} | } | ||||
@@ -137,9 +137,14 @@ Disk_Stream::shutdown ( void ) | |||||
block_processed(); | block_processed(); | ||||
usleep( 10 * 1000 ); | usleep( 10 * 1000 ); | ||||
} | } | ||||
_thread.join(); | |||||
} | } | ||||
/* thread may have terminated on it's own (due to punch out..), in | |||||
* any case join to clean up */ | |||||
_thread.join(); | |||||
DMESSAGE( "diskthread joined." ); | |||||
} | } | ||||
Track * | Track * | ||||
@@ -181,8 +181,6 @@ done: | |||||
// flush(); | // flush(); | ||||
_terminate = false; | _terminate = false; | ||||
_thread.exit(); | |||||
} | } | ||||
/** take a single block from the ringbuffers and send it out the | /** take a single block from the ringbuffers and send it out the | ||||
@@ -247,8 +247,6 @@ again: | |||||
_recording = false; | _recording = false; | ||||
DMESSAGE( "capture thread gone" ); | DMESSAGE( "capture thread gone" ); | ||||
_thread.exit(); | |||||
} | } | ||||
@@ -283,20 +281,9 @@ Record_DS::stop ( nframes_t frame ) | |||||
{ | { | ||||
THREAD_ASSERT( UI ); | THREAD_ASSERT( UI ); | ||||
if ( ! _recording ) | |||||
{ | |||||
WARNING( "programming error: attempt to stop recording when no recording is being made" ); | |||||
return; | |||||
} | |||||
_stop_frame = frame; | _stop_frame = frame; | ||||
// _recording = false; | |||||
// detach(); | |||||
DMESSAGE( "recording finished" ); | |||||
DMESSAGE( "recording stop scheduled" ); | |||||
} | } | ||||