Re: libtinymailui-gtk model notifications



Philip Van Hoof wrote:
On Wed, 2008-01-02 at 15:57 +0100, Philip Van Hoof wrote:
On Wed, 2008-01-02 at 12:41 +0100, Sergio Villar Senin wrote:
Hi

the gtk models issue the notifications using timeouts to put them into the main loop, but with the "new" async queue systems, the models receive the notifications from the main loop so no need to do that at all, or am I wrong?
Contrary in fact. Since everything runs in the account's queue, the
tny_list_prepend call is 'always' called by another thread than the
mainloop's thread. I fear that therefore those timeout tricks are
needed :-\

Hmm, no indeed. The "folder_changed" callback already throws it to the
mainloop for the TnyFolderMonitor to catch (as folder observer). So it
indeed already happens in the mainloop.

Yes, that's what I thought as well, but ... :-) there are some other situations where the model is modified by a thread like here

#0  notify_views_add (data=0x832d590) at tny-gtk-header-list-model.c:600
#1 0xb7e2be7a in tny_gtk_header_list_model_prepend (self=0x832d590, item=0x8219ec8)
    at tny-gtk-header-list-model.c:684
#2 0xb7dbc65d in tny_list_prepend (self=0x832d590, item=0x8219ec8) at tny-list.c:89 #3 0xb7df844d in add_message_with_uid (data=0x838c008, user_data=0x8399870) at tny-camel-folder.c:1985
#4  0xb728d49a in g_ptr_array_foreach () from /usr/lib/libglib-2.0.so.0
#5 0xb7df8bfb in tny_camel_folder_get_headers_default (self=0x8376328, headers=0x832d590, refresh=0,
    err=0x82674cc) at tny-camel-folder.c:2188
#6 0xb7df88cc in tny_camel_folder_get_headers (self=0x8376328, headers=0x832d590, refresh=0,
    err=0x82674cc) at tny-camel-folder.c:2126
#7 0xb7dc8253 in tny_folder_get_headers (self=0x8376328, headers=0x832d590, refresh=0, err=0x82674cc)
    at tny-folder.c:1317
#8 0xb7df858a in tny_camel_folder_get_headers_async_thread (thr_user_data=0x82674c0)

As you can see, this add_mesage_with_uid happens within a thread so we can not just simply remove the threads an timeout stuff.

Br


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