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

Joshua Colp asteriskteam at digium.com
Tue Sep 8 16:10:55 CDT 2015


Joshua Colp has submitted this change and it was merged.

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(-)

Approvals:
  Richard Mudgett: Looks good to me, but someone else must approve
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, approved



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: merged
Gerrit-Change-Id: Iae6befac9028b5b9795f86986a4a08a1ae6ab7c4
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>



More information about the asterisk-code-review mailing list