mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-12 21:30:45 +01:00
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:
parent
1370e309e7
commit
0614ed9d35
3 changed files with 2 additions and 33 deletions
|
@ -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
|
||||
|
|
|
@ -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_);
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in a new issue