public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] libstdc++/67408
@ 2015-09-01 11:09 Sebastian Huber
  0 siblings, 0 replies; only message in thread
From: Sebastian Huber @ 2015-09-01 11:09 UTC (permalink / raw)
  To: gcc-patches; +Cc: Sebastian Huber

2015-09-01  Sebastian Huber  <sebastian.huber@embedded-brains.de>

	PR libstdc++/67408
	* include/std/mutex (__timed_mutex_impl): Use __timedlock().
	(timed_mutex): Add friend class __timed_mutex_impl.  Add
	__timedlock().
	(recursive_timed_mutex): Likewise.
---
 libstdc++-v3/include/std/mutex | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/libstdc++-v3/include/std/mutex b/libstdc++-v3/include/std/mutex
index deb85df..2958e01 100644
--- a/libstdc++-v3/include/std/mutex
+++ b/libstdc++-v3/include/std/mutex
@@ -230,8 +230,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 	    static_cast<long>(__ns.count())
 	  };
 
-	  auto __mutex = static_cast<_Derived*>(this)->native_handle();
-	  return !__gthread_mutex_timedlock(__mutex, &__ts);
+	  return !static_cast<_Derived*>(this)->__timedlock(&__ts);
 	}
 
       template<typename _Clock, typename _Duration>
@@ -293,6 +292,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     native_handle_type
     native_handle()
     { return &_M_mutex; }
+
+  private:
+    friend class __timed_mutex_impl;
+
+    int
+    __timedlock(const __gthread_time_t *__abs_timeout)
+    { return __gthread_mutex_timedlock(&_M_mutex, __abs_timeout); }
   };
 
   /// recursive_timed_mutex
@@ -346,6 +352,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     native_handle_type
     native_handle()
     { return &_M_mutex; }
+
+  private:
+    friend class __timed_mutex_impl;
+
+    int
+    __timedlock(const __gthread_time_t *__abs_timeout)
+    { return __gthread_recursive_mutex_timedlock(&_M_mutex, __abs_timeout); }
   };
 #endif
 #endif // _GLIBCXX_HAS_GTHREADS
-- 
1.8.4.5

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-09-01 11:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-01 11:09 [PATCH] libstdc++/67408 Sebastian Huber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).