1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
$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);
|