Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/lib/libpthread Do not destroy mutices that failed to i...



details:   https://anonhg.NetBSD.org/src/rev/18fb3580c397
branches:  trunk
changeset: 934409:18fb3580c397
user:      martin <martin%NetBSD.org@localhost>
date:      Thu Jun 11 11:40:54 2020 +0000

description:
Do not destroy mutices that failed to init - fixes a run with
PTHREAD_DIAGASSERT set to "a". Pointed out by joerg.

diffstat:

 tests/lib/libpthread/t_mtx.c |  7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diffs (32 lines):

diff -r bdc23ea1ada6 -r 18fb3580c397 tests/lib/libpthread/t_mtx.c
--- a/tests/lib/libpthread/t_mtx.c      Thu Jun 11 11:05:29 2020 +0000
+++ b/tests/lib/libpthread/t_mtx.c      Thu Jun 11 11:40:54 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_mtx.c,v 1.1 2019/04/24 11:43:19 kamil Exp $  */
+/*     $NetBSD: t_mtx.c,v 1.2 2020/06/11 11:40:54 martin Exp $ */
 
 /*-
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include <sys/cdefs.h>
 __COPYRIGHT("@(#) Copyright (c) 2019\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_mtx.c,v 1.1 2019/04/24 11:43:19 kamil Exp $");
+__RCSID("$NetBSD: t_mtx.c,v 1.2 2020/06/11 11:40:54 martin Exp $");
 
 #include <time.h>
 #include <threads.h>
@@ -62,13 +62,10 @@
        mtx_destroy(&m);
 
        ATF_REQUIRE_EQ(mtx_init(&m, mtx_recursive), thrd_error);
-       mtx_destroy(&m);
 
        ATF_REQUIRE_EQ(mtx_init(&m, mtx_plain | mtx_timed), thrd_error);
-       mtx_destroy(&m);
 
        ATF_REQUIRE_EQ(mtx_init(&m, -1), thrd_error);
-       mtx_destroy(&m);
 }
 
 ATF_TC(mtx_lock);



Home | Main Index | Thread Index | Old Index