Re: block_cache

"Axel Dörfler" <[email protected]> Wed, 20 Aug 2008 16:17:27 +0200 CEST
Newsgroups gmane.os.openbeos.kernel.devel
Message-ID <26491370690-BeMail@zon>
"Salvatore Benedetto" <[email protected]> wrote:
> In cache_block_delete, the mutex_lock it seems to be called
> unconditionally.
> 
> Under the assumption that two thread can call block_cache_delete()
> on the very same cache object, it just will lead to a crash, as there 
> is
> not check on sCache.Remove(cache). Actually, I just relaized that it
> can crash sooner on block_cache_sync() if, after both thread have 
> entered
> the function, one of them succefully delete the object before the 
> call.

There is always only one owner of a block_cache - if it's called from 
more than one thread, something is broken, but it's not the 
block_cache. In the same way that bad things happen usually if you 
delete the same object twice.

Bye,
   Axel.


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/