Browse Source

Timeline: Fix assertion triggered by failure to join a diskthread which self-terminated due to punch-out.

tags/non-daw-v1.2.0
Jonathan Moore Liles 10 years ago
parent
commit
60059f4005
4 changed files with 13 additions and 19 deletions
  1. +5
    -1
      nonlib/Thread.C
  2. +7
    -2
      timeline/src/Engine/Disk_Stream.C
  3. +0
    -2
      timeline/src/Engine/Playback_DS.C
  4. +1
    -14
      timeline/src/Engine/Record_DS.C

+ 5
- 1
nonlib/Thread.C View File

@@ -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;
} }






+ 7
- 2
timeline/src/Engine/Disk_Stream.C View File

@@ -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 *


+ 0
- 2
timeline/src/Engine/Playback_DS.C View File

@@ -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


+ 1
- 14
timeline/src/Engine/Record_DS.C View File

@@ -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" );
} }






Loading…
Cancel
Save