diff options
Diffstat (limited to '')
-rw-r--r-- | cpukit/posix/src/cancel.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/cpukit/posix/src/cancel.c b/cpukit/posix/src/cancel.c index f2636e6a97..aa4a434037 100644 --- a/cpukit/posix/src/cancel.c +++ b/cpukit/posix/src/cancel.c @@ -38,14 +38,6 @@ int pthread_cancel( pthread_t thread ) Thread_Control *executing; Per_CPU_Control *cpu_self; - /* - * Don't even think about deleting a resource from an ISR. - */ - - if ( _ISR_Is_in_progress() ) { - return EPROTO; - } - the_thread = _Thread_Get( thread, &lock_context ); if ( the_thread == NULL ) { @@ -55,7 +47,10 @@ int pthread_cancel( pthread_t thread ) cpu_self = _Per_CPU_Get(); executing = _Per_CPU_Get_executing( cpu_self ); - if ( the_thread == executing ) { + if ( + the_thread == executing && + !_Per_CPU_Is_ISR_in_progress( cpu_self ) + ) { _ISR_lock_ISR_enable( &lock_context ); _Thread_Exit( PTHREAD_CANCELED, THREAD_LIFE_TERMINATING ); } else { |