From 700bf7af9f98174f33ac177332bcbcd644055474 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 14 Feb 2003 08:49:07 +0000 Subject: Update. 2003-02-14 Ulrich Drepper * Makefile (tests): Add tst-join4. * tst-join4.c: New file. 2003-02-13 Ulrich Drepper * tst-cond4.c (main): Add test of pthread_attr_getpshared. --- nptl/tst-cond4.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'nptl/tst-cond4.c') diff --git a/nptl/tst-cond4.c b/nptl/tst-cond4.c index ffc83c7668..6b57fbc7ee 100644 --- a/nptl/tst-cond4.c +++ b/nptl/tst-cond4.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 2002. @@ -140,12 +140,36 @@ main (void) exit (1); } + if (pthread_condattr_getpshared (&ca, &p) != 0) + { + puts ("1st condattr_getpshared failed"); + exit (1); + } + + if (p != PTHREAD_PROCESS_PRIVATE) + { + puts ("default value for pshared in condattr wrong"); + exit (1); + } + if (pthread_condattr_setpshared (&ca, PTHREAD_PROCESS_SHARED) != 0) { puts ("condattr_setpshared failed"); exit (1); } + if (pthread_condattr_getpshared (&ca, &p) != 0) + { + puts ("2nd condattr_getpshared failed"); + exit (1); + } + + if (p != PTHREAD_PROCESS_SHARED) + { + puts ("pshared condattr still not set"); + exit (1); + } + if (pthread_cond_init (cond, &ca) != 0) { puts ("cond_init failed"); -- cgit 1.4.1