diff options
author | Josh Blum <josh@joshknows.com> | 2010-10-08 16:04:22 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-10-08 16:04:22 -0700 |
commit | 787d89518d6dace0d8e6584e043eba99f5ff33e1 (patch) | |
tree | 3eec6754882a3ca9265e7308f0a90a55455d2344 /host | |
parent | 1190bc5c1a7bd0946bc55373eca58ec60a100f63 (diff) | |
download | uhd-787d89518d6dace0d8e6584e043eba99f5ff33e1.tar.gz uhd-787d89518d6dace0d8e6584e043eba99f5ff33e1.tar.bz2 uhd-787d89518d6dace0d8e6584e043eba99f5ff33e1.zip |
uhd: better warning message for failing to set rt priority
Diffstat (limited to 'host')
-rw-r--r-- | host/lib/utils/thread_priority.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/host/lib/utils/thread_priority.cpp b/host/lib/utils/thread_priority.cpp index c35e5fcb1..f09d1b1d6 100644 --- a/host/lib/utils/thread_priority.cpp +++ b/host/lib/utils/thread_priority.cpp @@ -16,6 +16,8 @@ // #include <uhd/utils/thread_priority.hpp> +#include <uhd/utils/warning.hpp> +#include <boost/format.hpp> #include <stdexcept> #include <iostream> @@ -24,7 +26,12 @@ bool uhd::set_thread_priority_safe(float priority, bool realtime){ set_thread_priority(priority, realtime); return true; }catch(const std::exception &e){ - std::cerr << "set_thread_priority: " << e.what() << std::endl; + uhd::print_warning(str(boost::format( + "%s\n" + "Failed to set thread priority %d (%s):\n" + "Performance may be negatively affected.\n" + "See the general application notes.\n" + ) % e.what() % priority % (realtime?"realtime":""))); return false; } } |