Re: Opening dialogs outside the Gtk thread?



Matthias Kaeppler wrote:

Dmitry Konyshev wrote:

gnome-vfs seems to send its notifications in context of the main thread.


I don't know. Does it? It almost seems so when looking at the Nautilus source, but I haven't read anything about that in the documentation. Afterall, its purpose is to allow for transfers running asynchronously to the main thread, so why should it call its signal handlers from anywhere but its own thread of execution?

gnome-vfs sources, file gnome-vfs-job.c, function job_notify. It adds idle handler, that calls the callback, to the main loop. It doesn't call the callback function by itself in its own thread.

I don't know how it happens that your function gets called from another thread.


I thought this is how gnome-vfs' async functions work. You connect your signal handlers, start the transfer(), it kicks off its own thread and sends updates periodically to report progress. In this case I see no reason why my signal handler would not be called from the thread which is running the transfer (and which is most certainly not the main thread).

You can use gdb to set up a break point in your function and see how execution flow gets to your function and in which thread's context.

wbr, Dmitry.




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