[glibmm/glibmm-2-56] Glib::MainContext: g_main_context_wait() is deprecated



commit fd8536f95018551150e5e1026545f2f7c036d119
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Thu Jul 5 11:22:11 2018 +0200

    Glib::MainContext: g_main_context_wait() is deprecated
    
    * glib/glibmm/main.cc: Add G_GNUC_[BEGIN|END]_IGNORE_DEPRECATIONS.
    * glib/glibmm/main.h: Update the description of MainContext::wait().

 glib/glibmm/main.cc |  2 ++
 glib/glibmm/main.h  | 22 ++++++++++------------
 2 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/glib/glibmm/main.cc b/glib/glibmm/main.cc
index 25ae0a79..30a294c4 100644
--- a/glib/glibmm/main.cc
+++ b/glib/glibmm/main.cc
@@ -597,6 +597,7 @@ MainContext::acquire()
 }
 
 #ifndef GLIBMM_DISABLE_DEPRECATED
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
 bool
 MainContext::wait(Glib::Cond& cond, Glib::Mutex& mutex)
 {
@@ -608,6 +609,7 @@ MainContext::wait(Glib::Threads::Cond& cond, Glib::Threads::Mutex& mutex)
 {
   return g_main_context_wait(gobj(), cond.gobj(), mutex.gobj());
 }
+G_GNUC_END_IGNORE_DEPRECATIONS
 #endif // GLIBMM_DISABLE_DEPRECATED
 
 void
diff --git a/glib/glibmm/main.h b/glib/glibmm/main.h
index 3b5e75ee..cfed1253 100644
--- a/glib/glibmm/main.h
+++ b/glib/glibmm/main.h
@@ -455,31 +455,29 @@ public:
   bool acquire();
 
 #ifndef GLIBMM_DISABLE_DEPRECATED
-  /** Tries to become the owner of the specified context, as with acquire(). But if another thread
-   * is the owner,
-   * atomically drop mutex and wait on cond until that owner releases ownership or until cond is
-   * signaled, then try
+  /** Tries to become the owner of the specified context, as with acquire().
+   * But if another thread is the owner, atomically drop mutex and wait on cond
+   * until that owner releases ownership or until cond is signaled, then try
    * again (once) to become the owner.
    * @param cond A condition variable.
    * @param mutex A mutex, currently held.
    * @return true if the operation succeeded, and this thread is now the owner of context.
    *
-   * @deprecated Use wait(Glib::Threads::Cond& cond, Glib::Threads::Mutex& mutex) instead.
+   * @deprecated Use the underlying g_main_context_is_owner() function
+   *   and separate locking, if you really need this functionality.
    */
   bool wait(Glib::Cond& cond, Glib::Mutex& mutex);
 
-  // Deprecated mostly because it uses deprecated Glib::Threads:: for parameters.
-  /** Tries to become the owner of the specified context, as with acquire(). But if another thread
-   * is the owner,
-   * atomically drop mutex and wait on cond until that owner releases ownership or until cond is
-   * signaled, then try
+  /** Tries to become the owner of the specified context, as with acquire().
+   * But if another thread is the owner, atomically drop mutex and wait on cond
+   * until that owner releases ownership or until cond is signaled, then try
    * again (once) to become the owner.
    * @param cond A condition variable.
    * @param mutex A mutex, currently held.
    * @return true if the operation succeeded, and this thread is now the owner of context.
    *
-   * @deprecated Please use the underlying g_main_context_wait() function if you really need this
-   * functionality.
+   * @deprecated Use the underlying g_main_context_is_owner() function
+   *   and separate locking, if you really need this functionality.
    */
   bool wait(Glib::Threads::Cond& cond, Glib::Threads::Mutex& mutex);
 #endif // GLIBMM_DISABLE_DEPRECATED


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]