Bug 1198458 Unbreak build on BSDs by fixing non-POSIX thread includes/usage. r=jesup

on a CLOSED TREE
This commit is contained in:
Jan Beich 2015-11-18 15:21:51 -05:00
parent c5d658f45c
commit 276c18aafc
3 changed files with 11 additions and 10 deletions

View File

@ -22,4 +22,4 @@
# 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

View File

@ -18,6 +18,14 @@
#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() {

View File

@ -22,13 +22,6 @@
#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
@ -166,9 +159,9 @@ void ThreadPosix::Run() {
#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