summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMurray Cumming <murrayc@murrayc.com>2015-11-26 10:38:50 +0100
committerMurray Cumming <murrayc@murrayc.com>2015-11-26 10:38:50 +0100
commit2f508058e9d8b790a66738335c47ea31d90f0b3d (patch)
treeea282b4d5060e18d0f2ac50ac3106f4681f92c44
parent4a6af0af0ca49596109681819286af9a2b311cc3 (diff)
downloadglibmm-2f508058e9d8b790a66738335c47ea31d90f0b3d.tar.gz
Glib::MainContext: Deprecate wait(cond, mutex).
Because it uses the deprecated Threads API in its API, and doesn't seem generally useful. As suggested here: https://bugzilla.gnome.org/show_bug.cgi?id=757674#c11
-rw-r--r--glib/glibmm/main.cc2
-rw-r--r--glib/glibmm/main.h5
2 files changed, 5 insertions, 2 deletions
diff --git a/glib/glibmm/main.cc b/glib/glibmm/main.cc
index 0f569778..53e2f496 100644
--- a/glib/glibmm/main.cc
+++ b/glib/glibmm/main.cc
@@ -601,12 +601,12 @@ bool MainContext::wait(Glib::Cond& cond, Glib::Mutex& mutex)
{
return g_main_context_wait(gobj(), cond.gobj(), mutex.gobj());
}
-#endif //GLIBMM_DISABLE_DEPRECATED
bool MainContext::wait(Glib::Threads::Cond& cond, Glib::Threads::Mutex& mutex)
{
return g_main_context_wait(gobj(), cond.gobj(), mutex.gobj());
}
+#endif //GLIBMM_DISABLE_DEPRECATED
void MainContext::release()
{
diff --git a/glib/glibmm/main.h b/glib/glibmm/main.h
index 51d7ff99..622f2db1 100644
--- a/glib/glibmm/main.h
+++ b/glib/glibmm/main.h
@@ -458,16 +458,19 @@ public:
* @deprecated Use wait(Glib::Threads::Cond& cond, Glib::Threads::Mutex& mutex) instead.
*/
bool wait(Glib::Cond& cond, Glib::Mutex& mutex);
-#endif //GLIBMM_DISABLE_DEPRECATED
+ //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
* 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.
*/
bool wait(Glib::Threads::Cond& cond, Glib::Threads::Mutex& mutex);
+#endif //GLIBMM_DISABLE_DEPRECATED
/** Releases ownership of a context previously acquired by this thread with acquire(). If the context was acquired
* multiple times, the only release ownership when release() is called as many times as it was acquired.