Re: block_cache

"Salvatore Benedetto" <[email protected]> Wed, 20 Aug 2008 15:08:38 +0000
Newsgroups gmane.os.openbeos.kernel.devel
Message-ID <[email protected]>
2008/8/20 Axel D=F6rfler <[email protected]>:
> "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.

Ok thanks! Sorry for the confusion.

Regards,
-- =

Salvatore Benedetto (a.k.a. emitrax)
Student of Computer Engineer
University of Pisa
www.haiku-os.it

-------------------------------------------------------------------------
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 priz=
es
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=3D100&url=3D/