Re: Attaching an event source to a GMainLoop in a thread



On Sun, 2006-12-03 at 21:26 +0000, Chris Vine wrote:

[snip]

Have you called g_thread_init() - the glib main loop is not thread safe 
otherwise?

Gah. That was it. Thanks.

There was a time that I knew about this requirement; but when setting
up this particular application, I forgot--and I hadn't thought about it
since.

If you are using gcc it won't be an issue but the callback should have C not 
C++ linkage (ie be declared extern "C").

That's taken care of by a forward declaration that I didn't bother
including in my e-mail; but thanks.

-- 
Braden McDaniel                           e-mail: <braden endoframe com>
<http://endoframe.com>                    Jabber: <braden jabber org>





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