source: rtems/cpukit/score/src/threadclose.c @ 59d1127

4.104.114.84.95
Last change on this file since 59d1127 was 05df0a8, checked in by Joel Sherrill <joel.sherrill@…>, on 05/17/99 at 20:41:13

Thread Handler split into multiple files. Eventually, as RTEMS is
split into one function per file, this will decrease the size of executables.

  • Property mode set to 100644
File size: 1.7 KB
Line 
1/*
2 *  Thread Handler
3 *
4 *
5 *  COPYRIGHT (c) 1989-1998.
6 *  On-Line Applications Research Corporation (OAR).
7 *  Copyright assigned to U.S. Government, 1994.
8 *
9 *  The license and distribution terms for this file may be
10 *  found in found in the file LICENSE in this distribution or at
11 *  http://www.OARcorp.com/rtems/license.html.
12 *
13 *  $Id$
14 */
15
16#include <rtems/system.h>
17#include <rtems/score/apiext.h>
18#include <rtems/score/context.h>
19#include <rtems/score/interr.h>
20#include <rtems/score/isr.h>
21#include <rtems/score/object.h>
22#include <rtems/score/priority.h>
23#include <rtems/score/states.h>
24#include <rtems/score/sysstate.h>
25#include <rtems/score/thread.h>
26#include <rtems/score/threadq.h>
27#include <rtems/score/userext.h>
28#include <rtems/score/wkspace.h>
29
30/*
31 *  _Thread_Close
32 *
33 *  DESCRIPTION:
34 *
35 *  XXX
36 */
37 
38void _Thread_Close(
39  Objects_Information  *information,
40  Thread_Control       *the_thread
41)
42{
43  _Objects_Close( information, &the_thread->Object );
44 
45  _Thread_Set_state( the_thread, STATES_TRANSIENT );
46 
47  if ( !_Thread_queue_Extract_with_proxy( the_thread ) ) {
48 
49    if ( _Watchdog_Is_active( &the_thread->Timer ) )
50      (void) _Watchdog_Remove( &the_thread->Timer );
51  }
52
53  _User_extensions_Thread_delete( the_thread );
54 
55#if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE )
56  if ( _Thread_Is_allocated_fp( the_thread ) )
57    _Thread_Deallocate_fp();
58#endif
59  the_thread->fp_context = NULL;
60
61  if ( the_thread->Start.fp_context )
62  (void) _Workspace_Free( the_thread->Start.fp_context );
63
64  _Thread_Stack_Free( the_thread );
65
66  if ( the_thread->extensions )
67    (void) _Workspace_Free( the_thread->extensions );
68
69  the_thread->Start.stack = NULL;
70  the_thread->extensions = NULL;
71}
Note: See TracBrowser for help on using the repository browser.