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?

-hb-

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to