source:
rtems/testsuites/psxtests/psxhdrs/mutex13.c
@
38cc8d53
Last change on this file since 38cc8d53 was 38cc8d53, checked in by Ralf Corsepius <ralf.corsepius@…>, on 10/17/11 at 11:17:11 | |
---|---|
|
|
File size: 842 bytes |
Rev | Line | |
---|---|---|
[41e7a1d8] | 1 | /* |
2 | * This test file is used to verify that the header files associated with | |
[2a53f31] | 3 | * invoking this function are correct. |
[41e7a1d8] | 4 | * |
[7a9030a0] | 5 | * COPYRIGHT (c) 1989-2009. |
[41e7a1d8] | 6 | * On-Line Applications Research Corporation (OAR). |
7 | * | |
[98e4ebf5] | 8 | * The license and distribution terms for this file may be |
9 | * found in the file LICENSE in this distribution or at | |
[3c48599] | 10 | * http://www.rtems.com/license/LICENSE. |
[41e7a1d8] | 11 | * |
12 | * $Id$ | |
13 | */ | |
14 | ||
[cafefbf] | 15 | #ifdef HAVE_CONFIG_H |
16 | #include "config.h" | |
17 | #endif | |
18 | ||
[41e7a1d8] | 19 | #include <pthread.h> |
[1b4f2b30] | 20 | |
[41e7a1d8] | 21 | #ifndef _POSIX_THREADS |
22 | #error "rtems is supposed to have pthread_mutex_timedlock" | |
23 | #endif | |
24 | #ifndef _POSIX_TIMEOUTS | |
25 | #error "rtems is supposed to have pthread_mutex_timedlock" | |
26 | #endif | |
27 | ||
[38cc8d53] | 28 | int test( void ); |
[7a9030a0] | 29 | |
[38cc8d53] | 30 | int test( void ) |
[41e7a1d8] | 31 | { |
32 | pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; | |
33 | struct timespec timeout; | |
34 | int result; | |
35 | ||
36 | result = pthread_mutex_timedlock( &mutex, &timeout ); | |
[38cc8d53] | 37 | |
38 | return result; | |
[41e7a1d8] | 39 | } |
Note: See TracBrowser
for help on using the repository browser.