diff options
author | Maarten Bosmans <mkbosmans@gmail.com> | 2011-01-06 00:51:33 +0100 |
---|---|---|
committer | Maarten Bosmans <mkbosmans@gmail.com> | 2011-02-17 11:58:22 +0100 |
commit | bb12ff83564d43566089dd979639c6993ba76665 (patch) | |
tree | 1d7df88762eeba464971742328b7617ffb93f3b3 /src/tests | |
parent | 0ac0479534d9cb6e4ef734eeb3a663f33a4f8ef3 (diff) |
Apply #ifdefs around functionality not available on win32
And also the reverse: around some win32 specific functionality
Diffstat (limited to 'src/tests')
-rw-r--r-- | src/tests/rtstutter.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/tests/rtstutter.c b/src/tests/rtstutter.c index c93fee93..21f33bf2 100644 --- a/src/tests/rtstutter.c +++ b/src/tests/rtstutter.c @@ -29,7 +29,10 @@ #include <sched.h> #include <inttypes.h> #include <string.h> + +#ifdef HAVE_PTHREAD #include <pthread.h> +#endif #include <pulse/timeval.h> #include <pulse/gccmacro.h> @@ -43,9 +46,6 @@ static int msec_lower, msec_upper; static void* work(void *p) PA_GCC_NORETURN; static void* work(void *p) { -#ifdef HAVE_PTHREAD_SETAFFINITY_NP - cpu_set_t mask; -#endif struct sched_param param; pa_log_notice("CPU%i: Created thread.", PA_PTR_TO_UINT(p)); @@ -55,9 +55,13 @@ static void* work(void *p) { pa_assert_se(pthread_setschedparam(pthread_self(), SCHED_FIFO, ¶m) == 0); #ifdef HAVE_PTHREAD_SETAFFINITY_NP +{ + cpu_set_t mask; + CPU_ZERO(&mask); CPU_SET((size_t) PA_PTR_TO_UINT(p), &mask); pa_assert_se(pthread_setaffinity_np(pthread_self(), sizeof(mask), &mask) == 0); +} #endif for (;;) { |