summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKjell Ahlstedt <kjellahlstedt@gmail.com>2018-07-05 11:22:11 +0200
committerKjell Ahlstedt <kjellahlstedt@gmail.com>2018-07-05 11:22:11 +0200
commitfd8536f95018551150e5e1026545f2f7c036d119 (patch)
tree2af56a507a630f8a0d1782e6c806407b2a2f842d
parenta12ff14046f4e53a435076cdcdc18b5e0f327066 (diff)
downloadglibmm-fd8536f95018551150e5e1026545f2f7c036d119.tar.gz
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().
-rw-r--r--glib/glibmm/main.cc2
-rw-r--r--glib/glibmm/main.h22
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