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
|
$NetBSD: patch-ac,v 1.3 2008/12/24 04:11:17 dsainty Exp $
--- src/tests/rtstutter.c.orig 2008-08-19 17:25:05.000000000 -0400
+++ src/tests/rtstutter.c 2008-12-23 13:25:08.000000000 -0500
@@ -42,6 +42,7 @@ static int msec_lower, msec_upper;
static void* work(void *p) PA_GCC_NORETURN;
static void* work(void *p) {
+#if 0
cpu_set_t mask;
struct sched_param param;
@@ -83,10 +84,11 @@ static void* work(void *p) {
} while (now.tv_sec < end.tv_sec ||
(now.tv_sec == end.tv_sec && now.tv_nsec < end.tv_nsec));
}
+#endif
}
int main(int argc, char*argv[]) {
- int n;
+ int n, ncpus;
srand((unsigned) time(NULL));
@@ -106,7 +108,12 @@ int main(int argc, char*argv[]) {
pa_log_notice("Creating random latencies in the range of %ims to %ims.", msec_lower, msec_upper);
- for (n = 1; n < sysconf(_SC_NPROCESSORS_CONF); n++) {
+#ifdef _SC_NPROCESSORS_CONF
+ ncpus = sysconf(_SC_NPROCESSORS_CONF);
+#else
+ ncpus = 1;
+#endif
+ for (n = 1; n < ncpus; n++) {
pthread_t t;
pa_assert_se(pthread_create(&t, NULL, work, PA_INT_TO_PTR(n)) == 0);
}
|