source: rtems/cpukit/posix/src/canceleval.c @ 75eaf66

4.104.115
Last change on this file since 75eaf66 was 75eaf66, checked in by Joel Sherrill <joel.sherrill@…>, on 07/21/09 at 14:16:00

2009-07-21 Joel Sherrill <joel.sherrill@…>

  • posix/include/rtems/posix/cancel.h, posix/src/cancel.c, posix/src/canceleval.c, posix/src/setcancelstate.c, posix/src/setcanceltype.c: Fix a minor bug in the previous modification which resulted in psxcancel failing.
  • Property mode set to 100644
File size: 1.0 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2009.
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
7 *  http://www.rtems.com/license/LICENSE.
8 *
9 *  $Id$
10 */
11
12#if HAVE_CONFIG_H
13#include "config.h"
14#endif
15
16#include <pthread.h>
17#include <rtems/system.h>
18#include <rtems/score/thread.h>
19#include <rtems/posix/cancel.h>
20#include <rtems/posix/pthread.h>
21
22void _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch(
23  Thread_Control    *the_thread
24)
25{
26  POSIX_API_Control *thread_support;
27  bool               cancel;
28
29  cancel         = false;
30  thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ];
31
32  if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE &&
33       thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS &&
34       thread_support->cancelation_requested )
35    cancel = true;
36 
37  _Thread_Enable_dispatch();
38 
39  if ( cancel )
40    _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED );
41}
Note: See TracBrowser for help on using the repository browser.