NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: bin/51888: [PATCH] tests/lib/libpthread/t_mutex: various fixes
The following reply was made to PR bin/51888; it has been noted by GNATS.
From: "Ngie Cooper (yaneurabeya)" <yaneurabeya%gmail.com@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc:
Subject: Re: bin/51888: [PATCH] tests/lib/libpthread/t_mutex: various fixes
Date: Sun, 15 Jan 2017 12:59:18 -0800
--Apple-Mail=_E95D8148-5E3C-4B59-ACC0-55837377EB3E
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=us-ascii
Patch attached.
-Ngie
--Apple-Mail=_E95D8148-5E3C-4B59-ACC0-55837377EB3E
Content-Disposition: attachment;
filename=t_mutex-various-fixes.patch
Content-Type: application/octet-stream;
x-unix-mode=0644;
name="t_mutex-various-fixes.patch"
Content-Transfer-Encoding: 7bit
Index: lib/libpthread/t_mutex.c
===================================================================
RCS file: /cvsroot/src/tests/lib/libpthread/t_mutex.c,v
retrieving revision 1.14
diff -u -r1.14 t_mutex.c
--- lib/libpthread/t_mutex.c 31 Oct 2016 23:51:20 -0000 1.14
+++ lib/libpthread/t_mutex.c 15 Jan 2017 20:56:43 -0000
@@ -31,6 +31,8 @@
The NetBSD Foundation, inc. All rights reserved.");
__RCSID("$NetBSD: t_mutex.c,v 1.14 2016/10/31 23:51:20 christos Exp $");
+#include <sys/time.h> /* For timespecadd */
+#include <inttypes.h> /* For UINT16_MAX */
#include <pthread.h>
#include <stdio.h>
#include <string.h>
@@ -570,9 +572,16 @@
int min_prio = sched_get_priority_min(SCHED_FIFO);
for (int i = min_prio; i <= max_prio; i++) {
int prioceiling;
+ int protocol;
+
+ PTHREAD_REQUIRE(pthread_mutexattr_getprotocol(&mattr,
+ &protocol));
+
+ printf("priority: %d\nprotocol: %d\n", i, protocol);
PTHREAD_REQUIRE(pthread_mutexattr_setprioceiling(&mattr, i));
PTHREAD_REQUIRE(pthread_mutexattr_getprioceiling(&mattr,
&prioceiling));
+ printf("prioceiling: %d\n", prioceiling);
ATF_REQUIRE_EQ(i, prioceiling);
}
}
--Apple-Mail=_E95D8148-5E3C-4B59-ACC0-55837377EB3E--
Home |
Main Index |
Thread Index |
Old Index