OSDN Git Service

2011-11-18 Paolo Carlini <paolo.carlini@oracle.com>
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / src / condition_variable.cc
index e7adb52..400fcf3 100644 (file)
 
 #if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1)
 
-_GLIBCXX_BEGIN_NAMESPACE(std)
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
 
-  condition_variable::condition_variable() throw ()
-  {
 #ifdef __GTHREAD_COND_INIT
-    __native_type __tmp = __GTHREAD_COND_INIT;
-    _M_cond = __tmp;
+  condition_variable::condition_variable() noexcept = default;
+  condition_variable::~condition_variable() noexcept = default;
 #else
+  condition_variable::condition_variable() noexcept
+  {
     int __e = __gthread_cond_init(&_M_cond, 0);
 
     if (__e)
       __throw_system_error(__e);
-#endif
   }
 
-  condition_variable::~condition_variable() throw ()
+  condition_variable::~condition_variable() noexcept
   {
     // XXX no thread blocked
     /* int __e = */ __gthread_cond_destroy(&_M_cond);
     // if __e == EBUSY then blocked
   }
+#endif
 
   void
   condition_variable::wait(unique_lock<mutex>& __lock)
@@ -58,7 +60,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
   }
 
   void
-  condition_variable::notify_one()
+  condition_variable::notify_one() noexcept
   {
     int __e = __gthread_cond_signal(&_M_cond);
 
@@ -69,7 +71,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
   }
 
   void
-  condition_variable::notify_all()
+  condition_variable::notify_all() noexcept
   {
     int __e = __gthread_cond_broadcast(&_M_cond);
 
@@ -79,12 +81,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       __throw_system_error(__e);
   }
 
-  condition_variable_any::condition_variable_any() throw ()
-  { }
+  condition_variable_any::condition_variable_any() noexcept = default;
 
-  condition_variable_any::~condition_variable_any() throw ()
-  { }
+  condition_variable_any::~condition_variable_any() noexcept = default;
 
-_GLIBCXX_END_NAMESPACE
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
 
 #endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1