issue #5601
authorKevin P. Fleming <kpfleming@digium.com>
Wed, 9 Nov 2005 00:16:08 +0000 (00:16 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Wed, 9 Nov 2005 00:16:08 +0000 (00:16 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7035 65c4cc65-6c06-0410-ace0-fbb531ad65f3

ChangeLog
res/res_features.c

index f6f9190..94d53e9 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2005-11-08  Kevin P. Fleming  <kpfleming@digium.com>
 
+       * res/res_features.c (ast_bridge_call_thread_launch): set SCHED_RR separately from thread creation, so it won't fail when running as non-root (issue #5601, different fix)
+
        * pbx.c (pbx_builtin_pushvar_helper): add new API function for setting variables that can exist multiple times (issue #2720)
        * apps/Makefile (APPS): add app_stack (issue #2720)
        * apps/app_stack.c: new applications (issue #2720)
index 92137a6..04cccc2 100755 (executable)
@@ -244,13 +244,14 @@ static void ast_bridge_call_thread_launch(void *data)
 {
        pthread_t thread;
        pthread_attr_t attr;
-       int result;
+       struct sched_param sched;
 
-       result = pthread_attr_init(&attr);
-       pthread_attr_setschedpolicy(&attr, SCHED_RR);
+       pthread_attr_init(&attr);
        pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
-       result = ast_pthread_create(&thread, &attr,ast_bridge_call_thread, data);
-       result = pthread_attr_destroy(&attr);
+       ast_pthread_create(&thread, &attr,ast_bridge_call_thread, data);
+       pthread_attr_destroy(&attr);
+       memset(&sched, 0, sizeof(sched));
+       pthread_setschedparam(thread, SCHED_RR, &sched);
 }