Remove calls to some POSIX APIs which Fuchsia does not implement.
Fuchsia's POSIX-lite does not provide the pthread priority nor file
locking APIs.
Bug: chromium:809201
Change-Id: I1efc5fe46909771e4934d91d2ed5f3e97c33444c
Reviewed-on: https://webrtc-review.googlesource.com/48860
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Commit-Queue: Wez <wez@google.com>
Cr-Commit-Position: refs/heads/master@{#21990}
diff --git a/rtc_base/platform_thread.cc b/rtc_base/platform_thread.cc
index 5f4e3e6..9495ef4 100644
--- a/rtc_base/platform_thread.cc
+++ b/rtc_base/platform_thread.cc
@@ -297,8 +297,8 @@
#if defined(WEBRTC_WIN)
return SetThreadPriority(thread_, priority) != FALSE;
-#elif defined(__native_client__)
- // Setting thread priorities is not supported in NaCl.
+#elif defined(__native_client__) || defined(WEBRTC_FUCHSIA)
+ // Setting thread priorities is not supported in NaCl or Fuchsia.
return true;
#elif defined(WEBRTC_CHROMIUM_BUILD) && defined(WEBRTC_LINUX)
// TODO(tommi): Switch to the same mechanism as Chromium uses for changing
diff --git a/rtc_base/stream.cc b/rtc_base/stream.cc
index b75490b..d937353 100644
--- a/rtc_base/stream.cc
+++ b/rtc_base/stream.cc
@@ -481,30 +481,6 @@
return false;
}
-#if defined(WEBRTC_POSIX) && !defined(__native_client__)
-
-bool FileStream::TryLock() {
- if (file_ == nullptr) {
- // Stream not open.
- RTC_NOTREACHED();
- return false;
- }
-
- return flock(fileno(file_), LOCK_EX|LOCK_NB) == 0;
-}
-
-bool FileStream::Unlock() {
- if (file_ == nullptr) {
- // Stream not open.
- RTC_NOTREACHED();
- return false;
- }
-
- return flock(fileno(file_), LOCK_UN) == 0;
-}
-
-#endif
-
void FileStream::DoClose() {
fclose(file_);
}
diff --git a/rtc_base/stream.h b/rtc_base/stream.h
index 9dba0ce..77e4bd8 100644
--- a/rtc_base/stream.h
+++ b/rtc_base/stream.h
@@ -400,13 +400,6 @@
bool Flush() override;
-#if defined(WEBRTC_POSIX) && !defined(__native_client__)
- // Tries to aquire an exclusive lock on the file.
- // Use OpenShare(...) on win32 to get similar functionality.
- bool TryLock();
- bool Unlock();
-#endif
-
protected:
virtual void DoClose();