commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 06/12: android: runtime: Android does not s


From: git
Subject: [Commit-gnuradio] [gnuradio] 06/12: android: runtime: Android does not support pthread_setaffinity_np; turned this into a nop call.
Date: Fri, 19 Feb 2016 13:58:39 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

trondeau pushed a commit to branch android
in repository gnuradio.

commit b13a209a40ac34afaf7129eab04380e80e9760c7
Author: Tom Rondeau <address@hidden>
Date:   Sun Dec 21 09:28:25 2014 -0500

    android: runtime: Android does not support pthread_setaffinity_np; turned 
this into a nop call.
---
 gnuradio-runtime/lib/CMakeLists.txt   |  2 +-
 gnuradio-runtime/lib/thread/thread.cc | 11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/gnuradio-runtime/lib/CMakeLists.txt 
b/gnuradio-runtime/lib/CMakeLists.txt
index f1add80..e8ec204 100644
--- a/gnuradio-runtime/lib/CMakeLists.txt
+++ b/gnuradio-runtime/lib/CMakeLists.txt
@@ -162,7 +162,7 @@ IF(HAVE_WINDOWS_H)
 ENDIF(HAVE_WINDOWS_H)
 
 #need to link with librt on ubuntu 11.10 for shm_*
-if(LINUX)
+if(LINUX AND !ANDROID)
     list(APPEND gnuradio_runtime_libs rt)
 endif()
 
diff --git a/gnuradio-runtime/lib/thread/thread.cc 
b/gnuradio-runtime/lib/thread/thread.cc
index 483dfed..44dbb37 100644
--- a/gnuradio-runtime/lib/thread/thread.cc
+++ b/gnuradio-runtime/lib/thread/thread.cc
@@ -241,6 +241,7 @@ namespace gr {
 
 #include <sstream>
 #include <stdexcept>
+#include <string>
 #include <pthread.h>
 #include <sys/prctl.h>
 
@@ -285,7 +286,12 @@ namespace gr {
       for(itr = _mask.begin(); itr != _mask.end(); itr++)
         CPU_SET(*itr, &set);
 
+#if !ANDROID
       int ret = pthread_setaffinity_np(thread, len, &set);
+#else
+      int ret = 0;
+#endif
+
       if(ret != 0) {
         std::stringstream s;
         s << "thread_bind_to_processor failed with error: " << ret << 
std::endl;
@@ -311,7 +317,12 @@ namespace gr {
         CPU_SET(n, &set);
       }
 
+#if !ANDROID
       int ret = pthread_setaffinity_np(thread, len, &set);
+#else
+      int ret = 0;
+#endif
+
       if(ret != 0) {
         std::stringstream s;
         s << "thread_unbind failed with error: " << ret << std::endl;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]