forked from Imagelibrary/rtems
2009-10-10 Joel Sherrill <joel.sherrill@oarcorp.com>
* posix/include/rtems/posix/threadsup.h, posix/src/cancel.c, posix/src/canceleval.c: Make psxcancel run again. _POSIX_Thread_Exit() can be called on running thread or another thread when it is cancelled.
This commit is contained in:
@@ -1,3 +1,10 @@
|
|||||||
|
2009-10-10 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||||
|
|
||||||
|
* posix/include/rtems/posix/threadsup.h, posix/src/cancel.c,
|
||||||
|
posix/src/canceleval.c: Make psxcancel run again.
|
||||||
|
_POSIX_Thread_Exit() can be called on running thread or another
|
||||||
|
thread when it is cancelled.
|
||||||
|
|
||||||
2009-10-10 Joel Sherrill <joel.sherrill@oarcorp.com>
|
2009-10-10 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||||
|
|
||||||
* posix/src/mqueuetimedreceive.c, posix/src/mqueuetimedsend.c,
|
* posix/src/mqueuetimedreceive.c, posix/src/mqueuetimedsend.c,
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ typedef struct {
|
|||||||
void _POSIX_Thread_Exit(
|
void _POSIX_Thread_Exit(
|
||||||
Thread_Control *the_thread,
|
Thread_Control *the_thread,
|
||||||
void *value_ptr
|
void *value_ptr
|
||||||
) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE;
|
);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
/* end of include file */
|
/* end of include file */
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ int pthread_cancel(
|
|||||||
|
|
||||||
thread_support->cancelation_requested = 1;
|
thread_support->cancelation_requested = 1;
|
||||||
|
|
||||||
|
/* This enables dispatch implicitly */
|
||||||
_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch( the_thread );
|
_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch( the_thread );
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|||||||
@@ -24,18 +24,15 @@ void _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch(
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
POSIX_API_Control *thread_support;
|
POSIX_API_Control *thread_support;
|
||||||
bool cancel;
|
|
||||||
|
|
||||||
cancel = false;
|
|
||||||
thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ];
|
thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ];
|
||||||
|
|
||||||
if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE &&
|
if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE &&
|
||||||
thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS &&
|
thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS &&
|
||||||
thread_support->cancelation_requested )
|
thread_support->cancelation_requested ) {
|
||||||
cancel = true;
|
_Thread_Unnest_dispatch();
|
||||||
|
|
||||||
_Thread_Enable_dispatch();
|
|
||||||
|
|
||||||
if ( cancel )
|
|
||||||
_POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED );
|
_POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED );
|
||||||
|
} else
|
||||||
|
_Thread_Enable_dispatch();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user