On Wed, Apr 02, 2014 at 05:03:53PM +0200, Honza Bambas wrote: > On 4/2/2014 11:33 AM, Nicolas B. Pierron wrote: > > > >--lock(mRefCnt); > >if (lock(mRefCnt) == 0) { > > delete this; > >} > > > >This way, this is more obvious that we might not be doing the right > >things, as long as we are careful to refuse AtomicHandler references in > >reviews. > > > > I personally don't think this will save us. This can easily slip through > review as well. > > Also, I'm using our mozilla::Atomic<> for not just refcounting but as an > easy lock-less t-s counters. If I had to change the code from mMyCounter += > something; to mozilla::Unused << AtomicFetchAndAdd(&mMyCounter, something); > I would not be happy :) > > According the refcnt code (or any code that may be concerned) better is to > treat is as "always thread safe" if not an overkill of course... Same as > you wear condoms with strangers, right?
so are you offering to audit all of the existing code that might be used with Atomic<T> to make sure it is threadsafe? Trev > > -hb- > > _______________________________________________ > dev-platform mailing list > dev-platform@lists.mozilla.org > https://lists.mozilla.org/listinfo/dev-platform
signature.asc
Description: Digital signature
_______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform