[glibmm] Glib::MainContext: Deprecate wait(cond, mutex).
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm] Glib::MainContext: Deprecate wait(cond, mutex).
- Date: Thu, 26 Nov 2015 10:07:27 +0000 (UTC)
commit 2f508058e9d8b790a66738335c47ea31d90f0b3d
Author: Murray Cumming <murrayc murrayc com>
Date: Thu Nov 26 10:38:50 2015 +0100
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
glib/glibmm/main.cc | 2 +-
glib/glibmm/main.h | 5 ++++-
2 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/glib/glibmm/main.cc b/glib/glibmm/main.cc
index 0f56977..53e2f49 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 51d7ff9..622f2db 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.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]