Timeline: Cancel unresponsive disk_threads.
This commit is contained in:
parent
51379e2e51
commit
e4d08afc68
|
@ -110,6 +110,13 @@ Thread::detach ( void )
|
|||
_thread = 0;
|
||||
}
|
||||
|
||||
void
|
||||
Thread::cancel ( void )
|
||||
{
|
||||
pthread_cancel( _thread );
|
||||
_thread = 0;
|
||||
}
|
||||
|
||||
void
|
||||
Thread::join ( void )
|
||||
{
|
||||
|
|
|
@ -52,6 +52,7 @@ public:
|
|||
bool clone ( void *(*entry_point)(void *), void *arg );
|
||||
void detach ( void );
|
||||
void join ( void );
|
||||
void cancel ( void );
|
||||
void exit ( void *retval = 0 );
|
||||
|
||||
};
|
||||
|
|
|
@ -155,12 +155,14 @@ Disk_Stream::shutdown ( void )
|
|||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
_thread.join();
|
||||
if ( ! _terminate )
|
||||
_thread.join();
|
||||
|
||||
sem_destroy( &_blocks );
|
||||
|
||||
|
|
Loading…
Reference in New Issue