Bug 1198458 Unbreak build on BSDs by fixing non-POSIX thread includes/usage. r=jesup
authorJan Beich <jbeich@FreeBSD.org>
Wed, 18 Nov 2015 15:21:51 -0500
changeset 307283 4f4010779e9a540d549a416628a8df1707f57980
parent 307282 72c01473646a645b18aec145a344c4775d2ad386
child 307284 a2ccdf48529ba5b597e1f77c9b1d2e8d70c32eb0
push id5513
push userraliiev@mozilla.com
push dateMon, 25 Jan 2016 13:55:34 +0000
treeherdermozilla-beta@5ee97dd05b5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup
bugs1198458
milestone45.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1198458 Unbreak build on BSDs by fixing non-POSIX thread includes/usage. r=jesup on a CLOSED TREE
CLOBBER
media/webrtc/trunk/webrtc/base/thread_checker_impl.cc
media/webrtc/trunk/webrtc/system_wrappers/source/thread_posix.cc
--- a/CLOBBER
+++ b/CLOBBER
@@ -17,9 +17,9 @@
 #
 # Modifying this file will now automatically clobber the buildbot machines \o/
 #
 
 # Are you updating CLOBBER because you think it's needed for your WebIDL
 # changes to stick? As of bug 928195, this shouldn't be necessary! Please
 # don't change CLOBBER for WebIDL changes any more.
 
-Bug 1210211 Fix build failures on OpenBSD caused by new XPIDL interface.
+Bug 1198458 Fix failures in TaskCluster builds due to analog_agc.cc moving
--- a/media/webrtc/trunk/webrtc/base/thread_checker_impl.cc
+++ b/media/webrtc/trunk/webrtc/base/thread_checker_impl.cc
@@ -13,16 +13,24 @@
 #include "webrtc/base/thread_checker_impl.h"
 
 #include "webrtc/base/checks.h"
 
 #if defined(WEBRTC_LINUX)
 #include <sys/syscall.h>
 #endif
 
+#if defined(__NetBSD__)
+#include <lwp.h>
+#elif defined(__FreeBSD__)
+#include <sys/param.h>
+#include <sys/thr.h>
+#include <pthread_np.h>
+#endif
+
 namespace rtc {
 
 PlatformThreadId CurrentThreadId() {
   PlatformThreadId ret;
 #if defined(WEBRTC_WIN)
   ret = GetCurrentThreadId();
 #elif defined(WEBRTC_POSIX)
 #if defined(WEBRTC_MAC) || defined(WEBRTC_IOS)
--- a/media/webrtc/trunk/webrtc/system_wrappers/source/thread_posix.cc
+++ b/media/webrtc/trunk/webrtc/system_wrappers/source/thread_posix.cc
@@ -17,23 +17,16 @@
 #ifdef WEBRTC_LINUX
 #include <linux/unistd.h>
 #include <sched.h>
 #include <sys/prctl.h>
 #include <sys/syscall.h>
 #include <sys/types.h>
 #endif
 
-#if defined(__NetBSD__)
-#include <lwp.h>
-#elif defined(__FreeBSD__)
-#include <sys/param.h>
-#include <sys/thr.h>
-#endif
-
 #if defined(WEBRTC_BSD) && !defined(__NetBSD__)
 #include <pthread_np.h>
 #endif
 
 #include "webrtc/base/checks.h"
 #include "webrtc/system_wrappers/interface/critical_section_wrapper.h"
 #include "webrtc/system_wrappers/interface/event_wrapper.h"
 #include "webrtc/system_wrappers/interface/sleep.h"
@@ -161,19 +154,19 @@ bool ThreadPosix::SetPriority(ThreadPrio
 
 void ThreadPosix::Run() {
   if (!name_.empty()) {
     // Setting the thread name may fail (harmlessly) if running inside a
     // sandbox. Ignore failures if they happen.
 #if (defined(WEBRTC_LINUX) || defined(WEBRTC_ANDROID) || defined(WEBRTC_GONK))
     prctl(PR_SET_NAME, reinterpret_cast<unsigned long>(name_.c_str()));
 #elif defined(__NetBSD__)
-    pthread_setname_np(pthread_self(), "%s", (void *)name_);
+    pthread_setname_np(pthread_self(), "%s", (void *)name_.c_str());
 #elif defined(WEBRTC_BSD)
-    pthread_set_name_np(pthread_self(), name_);
+    pthread_set_name_np(pthread_self(), name_.c_str());
 #elif defined(WEBRTC_MAC) || defined(WEBRTC_IOS)
     pthread_setname_np(name_.substr(0, 63).c_str());
 #endif
   }
 
   // It's a requirement that for successful thread creation that the run
   // function be called at least once (see RunFunctionIsCalled unit test),
   // so to fullfill that requirement, we use a |do| loop and not |while|.