mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-02-09 09:17:34 +00:00
FS-4695 fix apple build, seems there's no pthread_setschedprio on Mac, not sure if windows has the same problem in apr/threadproc/unix/thread.c
This commit is contained in:
parent
da0ff2d615
commit
0263ce9247
@ -174,10 +174,12 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((stat = pthread_create((*new)->td, temp, dummy_worker, (*new))) == 0) {
|
if ((stat = pthread_create((*new)->td, temp, dummy_worker, (*new))) == 0) {
|
||||||
|
#ifndef __APPLE__
|
||||||
if (attr->priority) {
|
if (attr->priority) {
|
||||||
pthread_t *thread = (*new)->td;
|
pthread_t *thread = (*new)->td;
|
||||||
pthread_setschedprio(*thread, attr->priority);
|
pthread_setschedprio(*thread, attr->priority);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return APR_SUCCESS;
|
return APR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -268,8 +268,12 @@ int su_pthreaded_port_start(su_port_create_f *create,
|
|||||||
|
|
||||||
pthread_mutex_lock(arg.mutex);
|
pthread_mutex_lock(arg.mutex);
|
||||||
if (pthread_create(&tid, &attr, su_pthread_port_clone_main, &arg) == 0) {
|
if (pthread_create(&tid, &attr, su_pthread_port_clone_main, &arg) == 0) {
|
||||||
#ifndef WIN32
|
|
||||||
/* this needs to be revisited when pthread for windows supports thread priority settings */
|
#if defined (WIN32)
|
||||||
|
/* this needs to be revisited when pthread for Windows supports thread priority settings */
|
||||||
|
#elif defined (__APPLE__)
|
||||||
|
/* no such function on Apple */
|
||||||
|
#else
|
||||||
pthread_setschedprio(tid, 99);
|
pthread_setschedprio(tid, 99);
|
||||||
#endif
|
#endif
|
||||||
pthread_cond_wait(arg.cv, arg.mutex);
|
pthread_cond_wait(arg.cv, arg.mutex);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user