Browse Source

Timeline: Cancel unresponsive disk_threads.

tags/non-daw-v1.2.0
Jonathan Moore Liles 12 years ago
parent
commit
e4d08afc68
3 changed files with 12 additions and 2 deletions
  1. +7
    -0
      nonlib/Thread.C
  2. +1
    -0
      nonlib/Thread.H
  3. +4
    -2
      timeline/src/Engine/Disk_Stream.C

+ 7
- 0
nonlib/Thread.C View File

@@ -110,6 +110,13 @@ Thread::detach ( void )
_thread = 0; _thread = 0;
} }


void
Thread::cancel ( void )
{
pthread_cancel( _thread );
_thread = 0;
}

void void
Thread::join ( void ) Thread::join ( void )
{ {


+ 1
- 0
nonlib/Thread.H View File

@@ -52,6 +52,7 @@ public:
bool clone ( void *(*entry_point)(void *), void *arg ); bool clone ( void *(*entry_point)(void *), void *arg );
void detach ( void ); void detach ( void );
void join ( void ); void join ( void );
void cancel ( void );
void exit ( void *retval = 0 ); void exit ( void *retval = 0 );


}; };

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

@@ -155,12 +155,14 @@ Disk_Stream::shutdown ( void )
if ( total_ms > 100 ) if ( total_ms > 100 )
{ {
WARNING("Disk_Stream thread has taken longer than %ims to respond to terminate signal.", total_ms );
WARNING("Disk_Stream thread has taken longer than %ims to respond to terminate signal. Canceling", total_ms );
_thread.cancel();
break; break;
} }
} }
_thread.join();
if ( ! _terminate )
_thread.join();


sem_destroy( &_blocks ); sem_destroy( &_blocks );




Loading…
Cancel
Save