mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-20 04:28:10 +00:00
implement msticker prio for non windows OS
git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@805 3f6dc0c8-ddfe-455d-9043-3cd528dc4637
This commit is contained in:
parent
23b6729f8e
commit
05eff701a8
1 changed files with 15 additions and 0 deletions
|
|
@ -265,6 +265,8 @@ static void sleepMs(int ms){
|
|||
|
||||
static int set_high_prio(void){
|
||||
int precision=2;
|
||||
int result=0;
|
||||
struct sched_param param;
|
||||
#ifdef WIN32
|
||||
MMRESULT mm;
|
||||
TIMECAPS ptc;
|
||||
|
|
@ -286,6 +288,19 @@ static int set_high_prio(void){
|
|||
if(!SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_HIGHEST)){
|
||||
ms_warning("SetThreadPriority() failed (%d)\n", GetLastError());
|
||||
}
|
||||
#else
|
||||
memset(¶m,0,sizeof(param));
|
||||
#ifdef TARGET_OS_MAC
|
||||
int policy=SCHED_RR;
|
||||
#else
|
||||
int policy=SCHED_OTHER;
|
||||
#endif
|
||||
param.sched_priority=sched_get_priority_max(policy);
|
||||
if(result=pthread_setschedparam(pthread_self(),policy, ¶m)) {
|
||||
ms_warning("Set sched param failed with error code(%i)\n",result);
|
||||
} else {
|
||||
ms_message("MS ticker priority set to max");
|
||||
}
|
||||
#endif
|
||||
return precision;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue