summaryrefslogtreecommitdiff
path: root/ham/gnuradio-core/patches/patch-gnuradio_runtime_lib_thread_thread_cc
blob: 8cf7fa5b9b55b04dcc83352629d2407bb054eabc (plain)
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
43
44
45
46
47
$NetBSD: patch-gnuradio_runtime_lib_thread_thread_cc,v 1.1 2014/10/13 12:46:33 mef Exp $

Extending for BSD

--- gnuradio-runtime/lib/thread/thread.cc.orig	2014-07-31 05:39:51.000000000 +0900
+++ gnuradio-runtime/lib/thread/thread.cc	2014-09-07 21:53:13.000000000 +0900
@@ -158,7 +158,7 @@ namespace gr {
 
 
 #elif defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__) || \
-    defined(__FreeBSD__)
+    defined(__FreeBSD__) || defined(__NetBSD__)
 
 namespace gr {
   namespace thread {
@@ -276,6 +276,7 @@ namespace gr {
     void
     thread_bind_to_processor(gr_thread_t thread, const std::vector<int> &mask)
     {
+#ifdef _GNU_SOURCE
       cpu_set_t set;
       size_t len = sizeof(cpu_set_t);
       std::vector<int> _mask = mask;
@@ -291,6 +292,7 @@ namespace gr {
         s << "thread_bind_to_processor failed with error: " << ret << std::endl;
         throw std::runtime_error(s.str());
       }
+#endif
     }
 
     void
@@ -302,6 +304,7 @@ namespace gr {
     void
     thread_unbind(gr_thread_t thread)
     {
+#ifdef _GNU_SOURCE
       cpu_set_t set;
       size_t len = sizeof(cpu_set_t);
 
@@ -317,6 +320,7 @@ namespace gr {
         s << "thread_unbind failed with error: " << ret << std::endl;
         throw std::runtime_error(s.str());
       }
+#endif
     }
 
     int