]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Core/General: Add #ifdef needed on FreeBSD. 24/1224/1
authorGuido Falsi <madpilot@freebsd.org>
Tue, 1 Sep 2015 15:16:55 +0000 (17:16 +0200)
committerJoshua Colp <jcolp@digium.com>
Tue, 8 Sep 2015 20:48:25 +0000 (15:48 -0500)
pthread_attr_init() defaults to PTHREAD_EXPLICIT_SCHED on FreeBSD
too.

ASTERISK-25310 #close
Reported by: Guido Falsi

Change-Id: Iae6befac9028b5b9795f86986a4a08a1ae6ab7c4

main/utils.c

index deb6d7e6022fe51b7f9b4a814dc9bf3d8419869e..3fa0b767847af746c610fb314cb4acbf93e0ea1d 100644 (file)
@@ -1242,8 +1242,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.