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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*
2
 *  $Id: cleanuppush.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_push(
23
  void   (*routine)( void * ),
24
  void    *arg
25
)
26
{
27
  POSIX_Cancel_Handler_control      *handler;
28
  Chain_Control                     *handler_stack;
29
  POSIX_API_Control                 *thread_support;
30
 
31
  if ( !routine )
32
    return;          /* XXX what to do really? */
33
 
34
  handler = _Workspace_Allocate( sizeof( POSIX_Cancel_Handler_control ) );
35
 
36
  if ( !handler )
37
    return;          /* XXX what to do really? */
38
 
39
  thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
40
 
41
  handler_stack = &thread_support->Cancellation_Handlers;
42
 
43
  handler->routine = routine;
44
  handler->arg = arg;
45
 
46
  _Chain_Append( handler_stack, &handler->Node );
47
}

powered by: WebSVN 2.1.0

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