aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-07-30 20:28:55 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-07-30 20:28:55 +0000
commitaeca77724e1faa38c541ef06a55f7baf0bef3d78 (patch)
treeab830c41ea105598433968cdc3bcb43dbcdecabc
parentbd09698c8455cd9ec4f44858466e31ba6882f994 (diff)
downloadpaludis-aeca77724e1faa38c541ef06a55f7baf0bef3d78.tar.gz
paludis-aeca77724e1faa38c541ef06a55f7baf0bef3d78.tar.xz
Tweak how we do thread priorities slightly
-rw-r--r--paludis/util/thread.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/paludis/util/thread.cc b/paludis/util/thread.cc
index 84937ce..8ae17c8 100644
--- a/paludis/util/thread.cc
+++ b/paludis/util/thread.cc
@@ -63,7 +63,8 @@ void
Thread::idle_adapter(const tr1::function<void () throw ()> & f)
{
#ifdef __linux__
- setpriority(PRIO_PROCESS, syscall(SYS_gettid), 10);
+ if (-1 == setpriority(PRIO_PROCESS, syscall(SYS_gettid), std::max(19, getpriority(PRIO_PROCESS, 0) + 10)))
+ Log::get_instance()->message(ll_warning, lc_context) << "Failed to setpriority: " << strerror(errno);
#else
# warning "Don't know how to set thread priorities on your platform"
#endif