summaryrefslogtreecommitdiff
path: root/ace/Sched_Params.cpp
diff options
context:
space:
mode:
authorlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-05-09 21:46:57 +0000
committerlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-05-09 21:46:57 +0000
commit06f36a39324526b8b25244202d457d908eace878 (patch)
treeb55afe5451d8e15633bf0c369833013243acc674 /ace/Sched_Params.cpp
parent78be92c9ad530ba6cca37cf9624767f0bff195ce (diff)
downloadATCD-06f36a39324526b8b25244202d457d908eace878.tar.gz
(priority_min): On Solaris (with STHREADS), don't return priority of 0 because ::pthread_attr_setschedparam () will refuse to use it (with EINVAL). So, bump priority of 0 up to 1.
Diffstat (limited to 'ace/Sched_Params.cpp')
-rw-r--r--ace/Sched_Params.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/ace/Sched_Params.cpp b/ace/Sched_Params.cpp
index adca11a096f..35b7bcdf5cf 100644
--- a/ace/Sched_Params.cpp
+++ b/ace/Sched_Params.cpp
@@ -63,11 +63,17 @@ ACE_Sched_Params::priority_min (const Policy policy,
// pcinfo.pc_clinfo)->ts_maxupri. The minimum priority is just
// the negative of that.
- return -((tsinfo_t *) pcinfo.pc_clinfo)->ts_maxupri;
+ int priority = -((tsinfo_t *) pcinfo.pc_clinfo)->ts_maxupri;
+
+ // Don't return priority of 0, because that can't be used with
+ // ::pthread_attr_setschedparam on Solaris 2.5.1.
+ return priority == 0 ? 1 : 0;
}
else
{
- return 0;
+ // Don't return priority of 0, because that can't be used with
+ // ::pthread_attr_setschedparam on Solaris 2.5.1.
+ return 1;
}
#elif defined (ACE_HAS_DCETHREADS) || defined(ACE_HAS_PTHREADS) && !defined(ACE_LACKS_SETSCHED)