OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [exec/] [posix/] [src/] [cleanuppop.c] - Blame information for rev 173

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*
2
 *  $Id: cleanuppop.c,v 1.2 2001-09-27 11:59:17 chris Exp $
3
 */
4
 
5
#include <pthread.h>
6
#include <errno.h>
7
 
8
#include <rtems/system.h>
9
#include <rtems/score/chain.h>
10
#include <rtems/score/isr.h>
11
#include <rtems/score/thread.h>
12
#include <rtems/score/wkspace.h>
13
#include <rtems/posix/cancel.h>
14
#include <rtems/posix/pthread.h>
15
#include <rtems/posix/threadsup.h>
16
 
17
/*PAGE
18
 *
19
 *  18.2.3.1 Establishing Cancellation Handlers, P1003.1c/Draft 10, p. 184
20
 */
21
 
22
void pthread_cleanup_pop(
23
  int    execute
24
)
25
{
26
  POSIX_Cancel_Handler_control      *handler;
27
  Chain_Control                     *handler_stack;
28
  POSIX_API_Control                 *thread_support;
29
  ISR_Level                          level;
30
 
31
  thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
32
 
33
  handler_stack = &thread_support->Cancellation_Handlers;
34
 
35
  if ( _Chain_Is_empty( handler_stack ) )
36
    return;
37
 
38
  _ISR_Disable( level );
39
    handler = (POSIX_Cancel_Handler_control *) _Chain_Tail( handler_stack );
40
    _Chain_Extract_unprotected( &handler->Node );
41
  _ISR_Enable( level );
42
 
43
  if ( execute )
44
    (*handler->routine)( handler->arg );
45
 
46
  _Workspace_Free( handler );
47
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.