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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*
2
 *  $Id: cancel.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.1 Canceling Execution of a Thread, P1003.1c/Draft 10, p. 181
20
 */
21
 
22
int pthread_cancel(
23
  pthread_t  thread
24
)
25
{
26
  Thread_Control                    *the_thread;
27
  POSIX_API_Control                 *thread_support;
28
  Objects_Locations                  location;
29
 
30
  the_thread = _POSIX_Threads_Get( thread, &location );
31
  switch ( location ) {
32
    case OBJECTS_ERROR:
33
      return EINVAL;
34
    case OBJECTS_REMOTE:
35
      return POSIX_MP_NOT_IMPLEMENTED();
36
    case OBJECTS_LOCAL:
37
      thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ];
38
 
39
      thread_support->cancelation_requested = 1;
40
 
41
      _Thread_Enable_dispatch();
42
      return 0;
43
  }
44
 
45
  return POSIX_BOTTOM_REACHED();
46
}

powered by: WebSVN 2.1.0

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