Re: Thread safety?



> +++ Murray Cumming [27/10/04 14:38 +0200]:
>>
>> It might be nice if you rewrote the FAQ entry that I stole from you, to
>> make it clearer:
>> http://www.gtkmm.org/docs/gtkmm-2.4/docs/FAQ/html/index.html#id2543317
>
> Having a look at that FAQ, I thought i'd give gdk_threads a go.. Since
> Gtk::Main doesn't initialise the GDK/Glib threads stuff (upon code
> inspection), I have to do it myself, right? Here is what I did:
>
>     g_thread_init(NULL);
>     gdk_threads_init();
>     m_pkMain = new Gtk::Main(argc, argv);

You don't need to call the C calls, but I'm not sure if it will make any
difference. There are some glibmm thread examples, such as:
http://cvs.gnome.org/viewcvs/glibmm/examples/thread/dispatcher2.cc?view=markup

> ..but the call to the Gtk::Main constructor caused a segfault. Do I not
> have to set this stuff up (is it done elsewhere)?

The first proper response to a segfault is to use a debugger, surely?

Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]