enhance 722f1060
with windows specific way
This commit is contained in:
parent
07122bd17c
commit
ed19343618
|
@ -733,12 +733,17 @@ SWITCH_DECLARE(int32_t) set_auto_priority(void)
|
||||||
{
|
{
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
runtime.cpu_count = sysconf (_SC_NPROCESSORS_ONLN);
|
runtime.cpu_count = sysconf (_SC_NPROCESSORS_ONLN);
|
||||||
|
#else
|
||||||
|
SYSTEM_INFO sysinfo;
|
||||||
|
GetSystemInfo( &sysinfo );
|
||||||
|
runtime.cpu_count = sysinfo.dwNumberOfProcessors;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* If we have more than 1 cpu, we should use realtime priority so we can have priority threads */
|
/* If we have more than 1 cpu, we should use realtime priority so we can have priority threads */
|
||||||
if (runtime.cpu_count > 1) {
|
if (runtime.cpu_count > 1) {
|
||||||
return set_realtime_priority();
|
return set_realtime_priority();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1403,6 +1408,12 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, switc
|
||||||
runtime.dbname = NULL;
|
runtime.dbname = NULL;
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
runtime.cpu_count = sysconf (_SC_NPROCESSORS_ONLN);
|
runtime.cpu_count = sysconf (_SC_NPROCESSORS_ONLN);
|
||||||
|
#else
|
||||||
|
{
|
||||||
|
SYSTEM_INFO sysinfo;
|
||||||
|
GetSystemInfo( &sysinfo );
|
||||||
|
runtime.cpu_count = sysinfo.dwNumberOfProcessors;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* INIT APR and Create the pool context */
|
/* INIT APR and Create the pool context */
|
||||||
|
|
Loading…
Reference in New Issue