Re: g_threads_enter() equivalent
- From: Mark Roberts <gtkmm manumark de>
- To: José Alburquerque <jaalburquerque cox net>
- Cc: Gtkmm Mailing List <gtkmm-list gnome org>
- Subject: Re: g_threads_enter() equivalent
- Date: Fri, 7 May 2010 13:12:29 +0200 (CEST)
Dear Talguy,
On Thu, 2010-05-06 at 16:20 -0400, Talguy wrote:
I was wondering if there is an equivalent function to
g_threads_enter()/leave() in gtkmm. Is gtkmm thread aware like gtk+
is. Reason why I would like to know is I want to port the multi
threaded animation example of cairo's site to gtkmm to better help me
out in my animations.
http://cairographics.org/threaded_animation_with_cairo/
There are not equivalent functions for those in gtkmm. However, there
are thread capabilities in glibmm that might be used to achieve similar
results (though from posts on this list using threads in gtkmm might not
be very straightforward). There are thread examples that can be used as
reference points:
http://library.gnome.org/devel/glibmm/stable/examples.html
--
José
The C++ way with pairs of functions like g_threads_enter() and
g_threads_leave() is using objects of utility classes like
Glib::Mutex::Lock. The constructor locks, the destructor unlocks. This
makes your program exception safe, because the destructor will not be
forgotten.
There is a list of thread related utility classes here:
http://library.gnome.org/devel/glibmm/unstable/group__Threads.html
There is an example that uses Glib::Mutex::Lock here:
http://library.gnome.org/devel/glibmm/stable/thread_2thread_8cc-example.html
Hope this helps,
Mark
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]