source: rtems/testsuites/psxtests/psx12/task.c @ 76e9a52f

4.115
Last change on this file since 76e9a52f was 76e9a52f, checked in by Joel Sherrill <joel.sherrill@…>, on 07/31/11 at 16:16:17

2011-07-31 Joel Sherrill <joel.sherrilL@…>

PR 1867/cpukit

  • Makefile.am, configure.ac, psx12/task.c, psxkey03/init.c, psxrwlock01/test.c: Correct implementation of pthread_exit() and pthread_join() to support the case where a thread is joinable but calls pthread_exit() before a thread has attempted to join.
  • Property mode set to 100644
File size: 866 bytes
Line 
1/*  Task_1
2 *
3 *  This routine serves as a test task.  It verifies the basic task
4 *  switching capabilities of the executive.
5 *
6 *  Input parameters:
7 *    argument - task argument
8 *
9 *  Output parameters:  NONE
10 *
11 *  COPYRIGHT (c) 1989-1999.
12 *  On-Line Applications Research Corporation (OAR).
13 *
14 *  The license and distribution terms for this file may be
15 *  found in the file LICENSE in this distribution or at
16 *  http://www.rtems.com/license/LICENSE.
17 *
18 *  $Id$
19 */
20
21#ifdef HAVE_CONFIG_H
22#include "config.h"
23#endif
24
25#include "system.h"
26#include <time.h>
27#include <sched.h>
28
29void *Task_1(
30  void *argument
31)
32{
33  /*
34   * Detach ourselves so we don't wait for a join that won't happen.
35   */
36  pthread_detach( pthread_self() );
37
38  puts( "Task_1: exitting" );
39  pthread_exit( NULL );
40
41  return NULL; /* just so the compiler thinks we returned something */
42}
Note: See TracBrowser for help on using the repository browser.