diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-05-22 20:38:03 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-05-22 20:38:03 +0000 |
commit | 345fc11da9dcad5faa23f9888c8f3a0260e8ad45 (patch) | |
tree | 561c791f8d6342c00391dea6c1dd47f08ac82612 /cpukit/posix/src/setcanceltype.c | |
parent | 2008-05-22 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-345fc11da9dcad5faa23f9888c8f3a0260e8ad45.tar.bz2 |
2008-05-22 Joel Sherrill <joel.sherrill@oarcorp.com>
* itron/include/rtems/itron/task.h, itron/src/del_tsk.c,
itron/src/exd_tsk.c, itron/src/task.c,
posix/include/rtems/posix/threadsup.h, posix/src/cancel.c,
posix/src/cancelrun.c, posix/src/pthread.c, posix/src/pthreadexit.c,
posix/src/setcancelstate.c, posix/src/setcanceltype.c,
posix/src/testcancel.c, rtems/src/taskdelete.c,
score/inline/rtems/score/object.inl, score/src/objectclose.c,
score/src/threadclose.c: Make all task delete/exit/cancel routines
follow the same critical section pattern. Also ensure that POSIX
cancelation routines are run at thread exit.
Diffstat (limited to 'cpukit/posix/src/setcanceltype.c')
-rw-r--r-- | cpukit/posix/src/setcanceltype.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/cpukit/posix/src/setcanceltype.c b/cpukit/posix/src/setcanceltype.c index 6a8a0c9860..fbd7beadf2 100644 --- a/cpukit/posix/src/setcanceltype.c +++ b/cpukit/posix/src/setcanceltype.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2007. + * COPYRIGHT (c) 1989-2008. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -35,7 +35,8 @@ int pthread_setcanceltype( int *oldtype ) { - POSIX_API_Control *thread_support; + POSIX_API_Control *thread_support; + boolean cancel = FALSE; /* * Don't even think about deleting a resource from an ISR. @@ -61,8 +62,10 @@ int pthread_setcanceltype( if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS && thread_support->cancelation_requested ) - _POSIX_Threads_cancel_run( _Thread_Executing ); + cancel = TRUE; _Thread_Enable_dispatch(); + if ( cancel ) + _POSIX_Thread_Exit( _Thread_Executing, PTHREAD_CANCELED ); return 0; } |