forked from Imagelibrary/rtems
psxtests/psxhdrs: Fix cleanup push/pop test
The pthread_cleanup_push() and pthread_cleanup_pop() statements must appear as a pair in the same lexical scope as required by POSIX.
This commit is contained in:
@@ -9,7 +9,7 @@ lib_a_SOURCES = clock01.c clock02.c clock03.c clock04.c clock05.c clock06.c \
|
||||
pthread13.c pthread14.c pthread15.c pthread16.c pthread17.c pthread18.c \
|
||||
pthread19.c pthread20.c pthread21.c pthread22.c pthread23.c pthread24.c \
|
||||
pthread25.c pthread26.c pthread27.c pthread28.c pthread29.c pthread30.c \
|
||||
pthread31.c pthread32.c pthread33.c pthread34.c pthread35.c pthread36.c \
|
||||
pthread31.c pthread32.c pthread34.c pthread35.c pthread36.c \
|
||||
pthread37.c pthread38.c pthread39.c pthread40.c \
|
||||
proc01.c proc02.c proc03.c proc04.c proc05.c proc06.c proc07.c proc08.c \
|
||||
proc09.c proc10.c proc11.c proc12.c proc13.c proc14.c sched01.c \
|
||||
|
||||
@@ -27,6 +27,7 @@ void cleanup_routine(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
(void) argument;
|
||||
}
|
||||
|
||||
void test( void )
|
||||
@@ -36,4 +37,5 @@ void test( void )
|
||||
argument = 0;
|
||||
|
||||
pthread_cleanup_push( cleanup_routine, &argument );
|
||||
pthread_cleanup_pop( 1 );
|
||||
}
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
/*
|
||||
* This test file is used to verify that the header files associated with
|
||||
* invoking this function are correct.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-2009.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rtems.com/license/LICENSE.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
#ifndef _POSIX_THREADS
|
||||
#error "rtems is supposed to have pthread_cleanup_pop"
|
||||
#endif
|
||||
|
||||
void test( void );
|
||||
|
||||
void test( void )
|
||||
{
|
||||
pthread_cleanup_pop( 1 );
|
||||
}
|
||||
Reference in New Issue
Block a user