mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-07-15 11:29:56 +00:00
FS-6211 revert 015ff5d787e6a28432d176002cc19cec1247407b and f6e591de4ad42a773f15359f1fc9799b6c86615c in favor of doing it in apr
This commit is contained in:
parent
7a6e8f4672
commit
729976df27
@ -595,21 +595,12 @@ struct apr_threadattr_t {
|
|||||||
int priority;
|
int priority;
|
||||||
};
|
};
|
||||||
#else
|
#else
|
||||||
/* we are implementing our own windows support for thread priority settings because apr does not*/
|
/* this needs to be revisited when apr for windows supports thread priority settings */
|
||||||
|
/* search for WIN32 in this file */
|
||||||
struct apr_threadattr_t {
|
struct apr_threadattr_t {
|
||||||
apr_pool_t *pool;
|
apr_pool_t *pool;
|
||||||
apr_int32_t detach;
|
apr_int32_t detach;
|
||||||
apr_size_t stacksize;
|
apr_size_t stacksize;
|
||||||
int priority;
|
|
||||||
};
|
|
||||||
struct apr_thread_t {
|
|
||||||
apr_pool_t *pool;
|
|
||||||
HANDLE td;
|
|
||||||
apr_int32_t cancel;
|
|
||||||
apr_int32_t cancel_how;
|
|
||||||
void *data;
|
|
||||||
apr_thread_start_t func;
|
|
||||||
apr_status_t exitval;
|
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -619,7 +610,9 @@ SWITCH_DECLARE(switch_status_t) switch_threadattr_create(switch_threadattr_t **
|
|||||||
switch_status_t status;
|
switch_status_t status;
|
||||||
|
|
||||||
if ((status = apr_threadattr_create(new_attr, pool)) == SWITCH_STATUS_SUCCESS) {
|
if ((status = apr_threadattr_create(new_attr, pool)) == SWITCH_STATUS_SUCCESS) {
|
||||||
|
#ifndef WIN32
|
||||||
(*new_attr)->priority = SWITCH_PRI_LOW;
|
(*new_attr)->priority = SWITCH_PRI_LOW;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
@ -637,7 +630,9 @@ SWITCH_DECLARE(switch_status_t) switch_threadattr_stacksize_set(switch_threadatt
|
|||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_threadattr_priority_set(switch_threadattr_t *attr, switch_thread_priority_t priority)
|
SWITCH_DECLARE(switch_status_t) switch_threadattr_priority_set(switch_threadattr_t *attr, switch_thread_priority_t priority)
|
||||||
{
|
{
|
||||||
|
#ifndef WIN32
|
||||||
attr->priority = priority;
|
attr->priority = priority;
|
||||||
|
#endif
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -646,16 +641,8 @@ static char TT_KEY[] = "1";
|
|||||||
SWITCH_DECLARE(switch_status_t) switch_thread_create(switch_thread_t ** new_thread, switch_threadattr_t *attr,
|
SWITCH_DECLARE(switch_status_t) switch_thread_create(switch_thread_t ** new_thread, switch_threadattr_t *attr,
|
||||||
switch_thread_start_t func, void *data, switch_memory_pool_t *cont)
|
switch_thread_start_t func, void *data, switch_memory_pool_t *cont)
|
||||||
{
|
{
|
||||||
apr_status_t status;
|
|
||||||
|
|
||||||
switch_core_memory_pool_set_data(cont, "_in_thread", TT_KEY);
|
switch_core_memory_pool_set_data(cont, "_in_thread", TT_KEY);
|
||||||
status = apr_thread_create(new_thread, attr, func, data, cont);
|
return apr_thread_create(new_thread, attr, func, data, cont);
|
||||||
#ifdef WIN32
|
|
||||||
if (attr->priority == SWITCH_PRI_REALTIME) {
|
|
||||||
SetThreadPriority(((apr_thread_t*)*new_thread)->td, THREAD_PRIORITY_HIGHEST);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
return (switch_status_t)status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* socket stubs */
|
/* socket stubs */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user