Re: A few remarks about locking



On 2002.03.25 16:54 Emmanuel wrote:
> It's written in a comment before the function 
> libbalsa_mailbox_load_messages(LibBalsaMailbox * mailbox) (in 
> libbalsa/mailbox.c) that it must be called with the gdk lock held. 
> But I think it's false. In fact I even try it without the gdk lock 
> and it works perfectly. I think that it is because we don't use any 
> UI function (we only emit signals and process the libmutt headers).

Just remember that the signal handlers may call GDK functions.

> But what seems strange to me is that in this function we process 
> libmutt datas without holding the mutt lock, is this correct (think 
> of another thread calling libmutt to change the same mailbox --> big 
> mess).

Yes, libmutt lock would not hurt there I guess (OTOH, the client 
context is locked by using LOCK_MAILBOX()).

-pawel




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