diff options
author | mfe <mfe@openoffice.org> | 2001-02-14 16:41:16 +0000 |
---|---|---|
committer | mfe <mfe@openoffice.org> | 2001-02-14 16:41:16 +0000 |
commit | fc5f06c04f866fe96933c40cedd044e5e0eae58a (patch) | |
tree | c1c6c5fac7ed9020b56efe768c9ab082e9a90724 /sal | |
parent | 8bcf2869f483631f9dfdd748b02071c2aee45199 (diff) |
fix sched priority
Diffstat (limited to 'sal')
-rw-r--r-- | sal/osl/unx/thread.c | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/sal/osl/unx/thread.c b/sal/osl/unx/thread.c index 909218f1d..fa2e7533f 100644 --- a/sal/osl/unx/thread.c +++ b/sal/osl/unx/thread.c @@ -2,9 +2,9 @@ * * $RCSfile: thread.c,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: mfe $ $Date: 2001-02-09 10:39:20 $ + * last change: $Author: mfe $ $Date: 2001-02-14 17:41:16 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -323,7 +323,6 @@ static void* oslWorkerWrapperFunction(void* pData) pthread_mutex_unlock(&pThreadImpl->m_AccessLock); - /* call worker-function with data */ pThreadImpl->m_WorkerFunction(pThreadImpl->m_pData); @@ -441,7 +440,7 @@ static sal_Bool osl_initThread() OSL_TRACE("failed to get priority of thread [%s]\n",strerror(nRet)); return sal_False; } - + #if defined (SOLARIS) if ( policy >= _SCHED_NEXT) { @@ -451,6 +450,30 @@ static sal_Bool osl_initThread() policy=SCHED_OTHER; } #endif + + if ( ( nRet = sched_get_priority_min(policy) ) >= 0 ) + { + OSL_TRACE("Min Prioriy for policy '%i' == '%i'\n",policy,nRet); + Thread_Prio_Lowest=nRet; + } +#if defined(DEBUG) + else + { + fprintf(stderr,"failed to get min sched param [%s]\n",strerror(errno)); + } +#endif + + if ( ( nRet = sched_get_priority_max(policy) ) >= 0 ) + { + OSL_TRACE("Max Prioriy for policy '%i' == '%i'\n",policy,nRet); + Thread_Prio_Highest=nRet; + } +#if defined(DEBUG) + else + { + fprintf(stderr,"failed to get max sched param [%s]\n",strerror(errno)); + } +#endif Thread_Prio_Normal = (Thread_Prio_Lowest + Thread_Prio_Highest) / 2; Thread_Prio_Below_Normal = (Thread_Prio_Lowest + Thread_Prio_Normal) / 2; @@ -702,7 +725,8 @@ void SAL_CALL osl_setThreadPriority(oslThread Thread, return; default: - OSL_ASSERT(sal_False); /* enum expanded, but forgotten here...*/ + /* enum expanded, but forgotten here...*/ + OSL_ENSURE(sal_False,"osl_setThreadPriority : unknown priority\n"); /* let release-version behave friendly */ return; |