From 787d89518d6dace0d8e6584e043eba99f5ff33e1 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Fri, 8 Oct 2010 16:04:22 -0700 Subject: uhd: better warning message for failing to set rt priority --- host/lib/utils/thread_priority.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'host/lib/utils') 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 +#include +#include #include #include @@ -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; } } -- cgit v1.2.3