2367213831
LibMicro is a portable set of microbenchmarks that many Solaris engineers used during Solaris 10 development to measure the performance of various system and library calls. LibMicro was developed by Bart Smaalders and Phil Harman as part of their "If Linux is faster it's a Solaris bug performance" campaign.
42 lines
1,001 B
Text
42 lines
1,001 B
Text
$NetBSD: patch-ab,v 1.1.1.1 2009/11/22 00:45:54 jym Exp $
|
|
|
|
--- cascade_mutex.c.orig 2007-07-02 23:17:45.000000000 +0200
|
|
+++ cascade_mutex.c
|
|
@@ -79,7 +79,9 @@ benchmark_init()
|
|
lm_defN = "cscd_mutex";
|
|
|
|
(void) sprintf(lm_usage,
|
|
+#if !defined(__NetBSD__)
|
|
" [-s] (force PTHREAD_PROCESS_SHARED)\n"
|
|
+#endif
|
|
"notes: thread cascade using pthread_mutexes\n");
|
|
|
|
return (0);
|
|
@@ -90,9 +92,11 @@ int
|
|
benchmark_optswitch(int opt, char *optarg)
|
|
{
|
|
switch (opt) {
|
|
+#if !defined(__NetBSD__)
|
|
case 's':
|
|
opts = 1;
|
|
break;
|
|
+#endif
|
|
default:
|
|
return (-1);
|
|
}
|
|
@@ -119,6 +123,7 @@ benchmark_initrun()
|
|
}
|
|
|
|
(void) pthread_mutexattr_init(&ma);
|
|
+#if !defined(__NetBSD__)
|
|
if (lm_optP > 1 || opts) {
|
|
(void) pthread_mutexattr_setpshared(&ma,
|
|
PTHREAD_PROCESS_SHARED);
|
|
@@ -126,6 +131,7 @@ benchmark_initrun()
|
|
(void) pthread_mutexattr_setpshared(&ma,
|
|
PTHREAD_PROCESS_PRIVATE);
|
|
}
|
|
+#endif
|
|
|
|
for (i = 0; i < nlocks; i++) {
|
|
(void) pthread_mutex_init(&locks[i], &ma);
|