summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorGuido Falsi <madpilot@freebsd.org>2015-09-01 17:16:55 +0200
committerJoshua Colp <jcolp@digium.com>2015-09-08 15:48:16 -0500
commit4ed9c9a280c08a17fce602c15d2b01de199ca736 (patch)
tree15a461c6316611b89c0a828dc36cc95a62204739 /main
parent9c5a0035d97f882502d9bb29698f481fd6573467 (diff)
Core/General: Add #ifdef needed on FreeBSD.
pthread_attr_init() defaults to PTHREAD_EXPLICIT_SCHED on FreeBSD too. ASTERISK-25310 #close Reported by: Guido Falsi Change-Id: Iae6befac9028b5b9795f86986a4a08a1ae6ab7c4
Diffstat (limited to 'main')
-rw-r--r--main/utils.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/main/utils.c b/main/utils.c
index f9a5be26c..ffef3ac97 100644
--- a/main/utils.c
+++ b/main/utils.c
@@ -1256,8 +1256,8 @@ int ast_pthread_create_stack(pthread_t *thread, pthread_attr_t *attr, void *(*st
pthread_attr_init(attr);
}
-#ifdef __linux__
- /* On Linux, pthread_attr_init() defaults to PTHREAD_EXPLICIT_SCHED,
+#if defined(__linux__) || defined(__FreeBSD__)
+ /* On Linux and FreeBSD , pthread_attr_init() defaults to PTHREAD_EXPLICIT_SCHED,
which is kind of useless. Change this here to
PTHREAD_INHERIT_SCHED; that way the -p option to set realtime
priority will propagate down to new threads by default.