Re: Calling gnome_url_show from a threaded program



I tried this, but it still doesn't work when the threads are enabled. I
commented out the thread init/creation functions, and it works if I do that,
but the minute any thread at all (remember, I'm not even calling this
function from the thread! It's from the parent process!) is introduced in
the program, the same problem occurs.

Is there a GTK threadsafe form of system() (or similar) that I could use
instead of gnome_url_show()?
There really isn't *any* way to launch a shell from a threaded program, is
there? Right now, I'd just skip the
gnome_url_show() and force the user to use whatever browser I put in the
command line, but I can't even
use system()! I'm lost........

Thanks for your help,

Jeff.

Havoc Pennington wrote:

> Jeff Maki <jeffmaki home com> writes:
> > I have a threaded program that has an endless thread which calls other
> > threads on demand.
> >
> > I wanted to have one of my help menu options bring up my project's
> > webpage. I tried to use gnome_url_show(), but it segfaults.
> >
> > How would I call gnome_url_show() from a threaded program without using
> > sephamores to block all threads? Is it possible?
> >
>
> gnome-libs isn't threadsafe at all (GTK+ isn't really either, but it
> does provide the global lock manipulated with
> gdk_threads_enter()/gdk_threads_leave(); gnome-libs doesn't use this
> lock). Anyway basically only one thread can use gnome-libs as far as I
> know.
>
> The easiest workaround is probably to queue an idle handler that shows
> the URL, since you can queue an idle handler from any thread. Have the
> idle handler return FALSE so that it runs only one time.
>
> Havoc





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