Re: Introduction of the TnyLockable



On Mon, 2007-01-22 at 19:07 +0100, Sergio Villar Senin wrote:
> Philip Van Hoof wrote:
> > On Mon, 2007-01-22 at 13:28 +0100, Sergio Villar Senin wrote:
> > 
> >>> You would have to do this three times (for the forget-pass, the get-pass
> >>> and the alert functions).
> >> Sure, you're right. The patch was just to explain the idea.
> >>
> >>> But if it works and you tested it a little bit, you can commit this.
> >> Well I tested it a little bit before sending the patch, and now I'm not
> >> getting some weird freezes that I got before. But as an important change
> >> I'll try to ensure that it works perfectly before committing anything.
> > 
> > Sounds good
> > 
> > 
> > Go ahead, etc.
> 
> I have another question, �are the tny_lockable_(un)lock located
> surrounding the g_main_loop_run really needed?


That's a good question. In gtk+ code they do this. I have no idea why. I
basically copied this from gtk+ code.

I imagine they do this to "give up" the gdk lock (because the current
thread is not going to run any gdk things anymore, as it will lock on
waiting for the other now-in-charge mainloop to end).

In such a way that the other thread (which runs a mainloop at that
moment too) can get a hold on the lock.

But that's just a guess. I havn't really in-depth investigated this, no.

-- 
Philip Van Hoof, software developer
home: me at pvanhoof dot be 
gnome: pvanhoof at gnome dot org 
http://www.pvanhoof.be/blog







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