diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | glib/src/thread.hg | 30 |
2 files changed, 21 insertions, 15 deletions
@@ -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 |