source: rtems/cpukit/posix/src/cancelrun.c @ a0e6c73

4.115
Last change on this file since a0e6c73 was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/12 at 15:09:24

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

  • Property mode set to 100644
File size: 1.3 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2008.
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
10#if HAVE_CONFIG_H
11#include "config.h"
12#endif
13
14#include <pthread.h>
15#include <errno.h>
16
17#include <rtems/system.h>
18#include <rtems/score/chain.h>
19#include <rtems/score/isr.h>
20#include <rtems/score/thread.h>
21#include <rtems/score/wkspace.h>
22#include <rtems/posix/cancel.h>
23#include <rtems/posix/pthread.h>
24#include <rtems/posix/threadsup.h>
25
26void _POSIX_Threads_cancel_run(
27  Thread_Control *the_thread
28)
29{
30  POSIX_Cancel_Handler_control      *handler;
31  Chain_Control                     *handler_stack;
32  POSIX_API_Control                 *thread_support;
33  ISR_Level                          level;
34
35  thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ];
36
37  handler_stack = &thread_support->Cancellation_Handlers;
38
39  thread_support->cancelability_state = PTHREAD_CANCEL_DISABLE;
40
41  while ( !_Chain_Is_empty( handler_stack ) ) {
42    _ISR_Disable( level );
43      handler = (POSIX_Cancel_Handler_control *)
44           _Chain_Tail( handler_stack )->previous;
45      _Chain_Extract_unprotected( &handler->Node );
46    _ISR_Enable( level );
47
48    (*handler->routine)( handler->arg );
49
50    _Workspace_Free( handler );
51  }
52}
Note: See TracBrowser for help on using the repository browser.