Skip to content

Commit

Permalink
chromium/base: Align sync primitives to OS/2.
Browse files Browse the repository at this point in the history
Neede for #3.
  • Loading branch information
dmik committed Mar 25, 2020
1 parent 6af2a5b commit b831168
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions chromium/base/synchronization/condition_variable_posix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ ConditionVariable::ConditionVariable(Lock* user_lock)
// non-standard pthread_cond_timedwait_monotonic_np. Newer platform
// versions have pthread_condattr_setclock.
// Mac can use relative time deadlines.
#if !defined(OS_MACOSX) && !defined(OS_NACL) && \
// OS/2 doesn't support monotonic deadlines either.
#if !defined(OS_MACOSX) && !defined(OS_OS2) && !defined(OS_NACL) && \
!(defined(OS_ANDROID) && defined(HAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC))
pthread_condattr_t attrs;
rv = pthread_condattr_init(&attrs);
Expand Down Expand Up @@ -101,8 +102,8 @@ void ConditionVariable::TimedWait(const TimeDelta& max_time) {
#else
// The timeout argument to pthread_cond_timedwait is in absolute time.
struct timespec absolute_time;
#if defined(OS_NACL)
// See comment in constructor for why this is different in NaCl.
#if defined(OS_NACL) || defined(OS_OS2)
// See comment in constructor for why this is different in NaCl and OS/2.
struct timeval now;
gettimeofday(&now, NULL);
absolute_time.tv_sec = now.tv_sec;
Expand Down
3 changes: 2 additions & 1 deletion chromium/base/synchronization/lock_impl_posix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ std::string SystemErrorCodeToString(int error_code) {
// Lock::PriorityInheritanceAvailable still must be checked as the code may
// compile but the underlying platform still may not correctly support priority
// inheritance locks.
#if defined(OS_NACL) || defined(OS_ANDROID) || defined(OS_FUCHSIA)
#if defined(OS_NACL) || defined(OS_ANDROID) || defined(OS_FUCHSIA) || \
defined(OS_OS2)
#define PRIORITY_INHERITANCE_LOCKS_POSSIBLE() 0
#else
#define PRIORITY_INHERITANCE_LOCKS_POSSIBLE() 1
Expand Down

0 comments on commit b831168

Please sign in to comment.