mirror of git://gcc.gnu.org/git/gcc.git
re PR libstdc++/67408 (<mutex> assumes that __gthread_mutex_t and__gthread_recursive_mutex_t are the same types)
2015-09-02 Sebastian Huber <sebastian.huber@embedded-brains.de> PR libstdc++/67408 * include/std/mutex (__timed_mutex_impl::_M_try_lock_until): Use _Derived::_M_timedlock(). (timed_mutex): Add _M_timedlock() and make base class a friend. (recursive_timed_mutex): Likewise. From-SVN: r227400
This commit is contained in:
parent
1c743086d2
commit
d8e19f3114
|
|
@ -1,3 +1,11 @@
|
||||||
|
2015-09-02 Sebastian Huber <sebastian.huber@embedded-brains.de>
|
||||||
|
|
||||||
|
PR libstdc++/67408
|
||||||
|
* include/std/mutex (__timed_mutex_impl::_M_try_lock_until): Use
|
||||||
|
_Derived::_M_timedlock().
|
||||||
|
(timed_mutex): Add _M_timedlock() and make base class a friend.
|
||||||
|
(recursive_timed_mutex): Likewise.
|
||||||
|
|
||||||
2015-08-28 Tim Shen <timshen@google.com>
|
2015-08-28 Tim Shen <timshen@google.com>
|
||||||
|
|
||||||
PR libstdc++/67362
|
PR libstdc++/67362
|
||||||
|
|
|
||||||
|
|
@ -230,8 +230,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||||
static_cast<long>(__ns.count())
|
static_cast<long>(__ns.count())
|
||||||
};
|
};
|
||||||
|
|
||||||
auto __mutex = static_cast<_Derived*>(this)->native_handle();
|
return static_cast<_Derived*>(this)->_M_timedlock(__ts);
|
||||||
return !__gthread_mutex_timedlock(__mutex, &__ts);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename _Clock, typename _Duration>
|
template<typename _Clock, typename _Duration>
|
||||||
|
|
@ -293,6 +292,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||||
native_handle_type
|
native_handle_type
|
||||||
native_handle()
|
native_handle()
|
||||||
{ return &_M_mutex; }
|
{ return &_M_mutex; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
friend class __timed_mutex_impl<timed_mutex>;
|
||||||
|
|
||||||
|
bool
|
||||||
|
_M_timedlock(const __gthread_time_t& __ts)
|
||||||
|
{ return !__gthread_mutex_timedlock(&_M_mutex, &__ts); }
|
||||||
};
|
};
|
||||||
|
|
||||||
/// recursive_timed_mutex
|
/// recursive_timed_mutex
|
||||||
|
|
@ -346,6 +352,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||||
native_handle_type
|
native_handle_type
|
||||||
native_handle()
|
native_handle()
|
||||||
{ return &_M_mutex; }
|
{ return &_M_mutex; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
friend class __timed_mutex_impl<recursive_timed_mutex>;
|
||||||
|
|
||||||
|
bool
|
||||||
|
_M_timedlock(const __gthread_time_t& __ts)
|
||||||
|
{ return !__gthread_recursive_mutex_timedlock(&_M_mutex, &__ts); }
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
#endif // _GLIBCXX_HAS_GTHREADS
|
#endif // _GLIBCXX_HAS_GTHREADS
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue