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}
This commit is contained in:
Wez 2018-02-06 13:38:21 -08:00 committed by Commit Bot
parent 1370e309e7
commit 0614ed9d35
3 changed files with 2 additions and 33 deletions

View file

@ -297,8 +297,8 @@ bool PlatformThread::SetPriority(ThreadPriority priority) {
#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

View file

@ -481,30 +481,6 @@ bool FileStream::Flush() {
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_);
}

View file

@ -400,13 +400,6 @@ class FileStream : public StreamInterface {
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();