Re: [evolution-patches] fix for file backend race



committed

On Fri, 2004-03-12 at 12:19 -0800, Chris Toshok wrote:

> So, all the addressbook backends suffer from this problem potentionally.
> I know the ldap one does, in fact that's the only backend I've seen
> crash because of it.  I'll have a patch for that soon.  The file backend
> is a little simpler, so I did it first.
> 
> The problem is that since start() and stop() are oneway methods, and
> handled on their own threads, it's entirely possible if a client is
> doing many queries very fast, stopping the old one and starting the new
> one, that the stop() code might actually be executed before the start()
> code on a given view.
> 
> This leads to a query running on a book view that (shortly after stop()
> is called, at least by evolution) gets destroyed out from under it,
> causing the crash.
> 
> This patch adds a mutex to EDataBookView that backends can use to
> synchronize their start/stop methods, and adds some code to both the
> start and stop methods of the file backend to guard against the
> possibility of the other being called first.
> 
> fun fun fun
> 
> Chris



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