Re: [patch] Bug 1119: race condition in Dialogs::show()

2005-02-14 Thread Angus Leeming
Andreas Vox wrote: > I think the > > void method() { > if  (in_method)  return; > in_method  =  true; > //  do  something > in_method  =  false; > } > > pattern is quite simple and safe. It just protects the method against > involuntary indirect recursive calls. I agree entirely

Re: [patch] Bug 1119: race condition in Dialogs::show()

2005-02-14 Thread Andreas Vox
Angus Leeming <[EMAIL PROTECTED]> writes: > > Andreas Vox wrote: > > I'm just > thinking of the future when we have multiple LyX windows, each with their > own set of dialogs. > > One improvement over your original patch would be to make 'showing' a > member of the src/frontends/Dialogs

Re: [patch] Bug 1119: race condition in Dialogs::show()

2005-02-14 Thread Angus Leeming
Andreas Vox wrote: > Angus Leeming <[EMAIL PROTECTED]> writes: > >> >> Question: do you need to protect the call to "find_or_build"? > > Probably find_or_build needs to be protected from being called > while a second show() hasn't finished yet. Maybe not. > Doesn't matter because you have to pr

Re: [patch] Bug 1119: race condition in Dialogs::show()

2005-02-14 Thread Andreas Vox
Angus Leeming <[EMAIL PROTECTED]> writes: > > Question: do you need to protect the call to "find_or_build"? Probably find_or_build needs to be protected from being called while a second show() hasn't finished yet. Maybe not. Doesn't matter because you have to prevent the following call to dialo

Re: [patch] Bug 1119: race condition in Dialogs::show()

2005-02-14 Thread Angus Leeming
Andreas Vox wrote: >> It seems to me that the global 'bool showing' should actually be a >> one-per-dialog variable. > ... >> Do I miss anything? >> > The "showing" flag only protects the call to show() itself, therefore it > should be named "opening". > The dialog is shown between the call to show

Re: [patch] Bug 1119: race condition in Dialogs::show()

2005-02-14 Thread Andreas Vox
Angus Leeming <[EMAIL PROTECTED]> writes: > I don't think that the patch should be committed as it is, although it has > enabled Andreas to work out what was going wrong --- good detective work, > Andreas! Thanks! :-) > > It seems to me that the global 'bool showing' should actually be a >

Re: [patch] Bug 1119: race condition in Dialogs::show()

2005-02-14 Thread Angus Leeming
Juergen Spitzmueller wrote: > John Levon wrote: >> > The attached patch just ignores subsequent calls to show if the old >> > one isn't finished yet. >> >> I think this is pretty much the right thing to do. > > So should this patch be committed? I don't think that the patch should be committed a

Re: [patch] Bug 1119: race condition in Dialogs::show()

2005-02-14 Thread Juergen Spitzmueller
John Levon wrote: > > The attached patch just ignores subsequent calls to show if the old one > > isn't finished yet. > > I think this is pretty much the right thing to do. So should this patch be committed? Jürgen BTW I think valgrind's Helgrind seems to be useful to track down such problems.

Re: [patch] Bug 1119: race condition in Dialogs::show()

2005-02-10 Thread John Levon
On Fri, Feb 11, 2005 at 01:55:34AM +0100, Andreas Vox wrote: > The attached patch just ignores subsequent calls to show if the old one > isn't finished yet. I think this is pretty much the right thing to do. In the general sense we can be half-initialised during show, so if we enter the event lo

[patch] Bug 1119: race condition in Dialogs::show()

2005-02-10 Thread Andreas Vox
Hi all! I added some debug output at the start and end of the Dialogs::show() method. This is what I got before, with the testfile from the bugreport: Dialogs::show(citation Dialogs::show(citation Dialogs::show(citation Dialogs::show citation) Dialogs::show citation) Dialogs::show citation) Dialo