[Asterisk-code-review] Core/General: Add #ifdef needed on FreeBSD. (asterisk[13])

Joshua Colp asteriskteam at digium.com
Tue Sep 8 15:48:16 CDT 2015


Joshua Colp has uploaded a new change for review.

  https://gerrit.asterisk.org/1223

Change subject: Core/General: Add #ifdef needed on FreeBSD.
......................................................................

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
---
M main/utils.c
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/23/1223/1

diff --git a/main/utils.c b/main/utils.c
index f9a5be2..ffef3ac 100644
--- a/main/utils.c
+++ b/main/utils.c
@@ -1256,8 +1256,8 @@
 		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.

-- 
To view, visit https://gerrit.asterisk.org/1223
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iae6befac9028b5b9795f86986a4a08a1ae6ab7c4
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Guido Falsi <madpilot at freebsd.org>



More information about the asterisk-code-review mailing list