source: rtems/c/src/exec/posix/src/pthreadexit.c @ 26c828f

4.104.114.84.95
Last change on this file since 26c828f was 26c828f, checked in by Joel Sherrill <joel.sherrill@…>, on 11/02/99 at 15:29:04

Added assert in case _Objects_Get_information fails since this
should NEVER occur.

  • Property mode set to 100644
File size: 1.1 KB
Line 
1/*
2 *  16.1.5.1 Thread Termination, p1003.1c/Draft 10, p. 150
3 *
4 *  NOTE: Key destructors are executed in the POSIX api delete extension.
5 *
6 *  COPYRIGHT (c) 1989-1998.
7 *  On-Line Applications Research Corporation (OAR).
8 *  Copyright assigned to U.S. Government, 1994.
9 *
10 *  The license and distribution terms for this file may be
11 *  found in the file LICENSE in this distribution or at
12 *  http://www.OARcorp.com/rtems/license.html.
13 *
14 *  $Id$
15 */
16
17
18#include <pthread.h>
19#include <errno.h>
20#include <assert.h>
21
22#include <rtems/system.h>
23#include <rtems/score/thread.h>
24#include <rtems/posix/pthread.h>
25
26void pthread_exit(
27  void  *value_ptr
28)
29{
30  Objects_Information     *the_information;
31
32  the_information = _Objects_Get_information( _Thread_Executing->Object.id );
33
34  /* This should never happen if _Thread_Get() works right */
35  assert( the_information );
36
37  _Thread_Disable_dispatch();
38
39  _Thread_Executing->Wait.return_argument = (unsigned32 *)value_ptr;
40
41  _Thread_Close( the_information, _Thread_Executing );
42
43  _POSIX_Threads_Free( _Thread_Executing );
44
45  _Thread_Enable_dispatch();
46}
47
Note: See TracBrowser for help on using the repository browser.