summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Elstner <danielk@openismus.com>2009-09-03 16:34:37 +0200
committerDaniel Elstner <danielk@openismus.com>2009-09-03 16:34:37 +0200
commit5b995955d4bbd97041aeda2780b1f68419bbb55e (patch)
tree524e6324b8c9d042d874b2187bffa3fcadfe4bdc
parent24683d74eaecc51b77ae27b36cd5d686692a7358 (diff)
downloadglibmm-5b995955d4bbd97041aeda2780b1f68419bbb55e.tar.gz
Sanitize the Glib::Cond usage example
* glib/src/thread.hg (Glib::Cond): Sanitize the usage example.
-rw-r--r--ChangeLog6
-rw-r--r--glib/src/thread.hg30
2 files changed, 21 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index ab9b827c..4c018177 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-09-03 Daniel Elstner <danielk@openismus.com>
+
+ Sanitize the Glib::Cond usage example
+
+ * glib/src/thread.hg (Glib::Cond): Sanitize the usage example.
+
2009-09-02 Daniel Elstner <danielk@openismus.com>
Remove sigc from the Doxygen excluded symbols
diff --git a/glib/src/thread.hg b/glib/src/thread.hg
index 60696fdc..f02a6402 100644
--- a/glib/src/thread.hg
+++ b/glib/src/thread.hg
@@ -589,28 +589,28 @@ private:
* they can signal the @a Cond, such that the waiting thread is woken up.
* @par Usage example:
* @code
- * Glib::Cond data_cond;
+ * Glib::Cond data_cond;
* Glib::Mutex data_mutex;
- * void* current_data = NULL;
- *
- * void push_data (void* data)
+ * void* current_data = 0;
+ *
+ * void push_data(void* data)
* {
- * data_mutex.lock();
+ * Glib::Mutex::Lock lock (data_mutex);
+ *
* current_data = data;
* data_cond.signal();
- * data_mutex.unlock();
* }
- *
- * void* pop_data ()
+ *
+ * void* pop_data()
* {
- * void* data;
- *
- * data_mutex.lock();
+ * Glib::Mutex::Lock lock (data_mutex);
+ *
* while (!current_data)
- * data_cond.wait(data_mutex);
- * data = current_data;
- * current_data = NULL;
- * data_mutex.unlock();
+ * data_cond.wait(data_mutex);
+ *
+ * void *const data = current_data;
+ * current_data = 0;
+ *
* return data;
* }
* @endcode