Add a comment to WeakPtr.h which explicitly calls out the fact that it's not thread-safe, no bug, DONTBUILD
authorEhsan Akhgari <ehsan@mozilla.com>
Fri, 28 Mar 2014 00:12:30 -0400
changeset 195395 7d5848e153010a645c109343cf57cd118c4e078b
parent 195394 d9e6a6c40a57393d318e236558f799481cf7074f
child 195396 fabc466d8703e563a0044661b23c67c9f6ad6103
push id486
push userasasaki@mozilla.com
push dateMon, 14 Jul 2014 18:39:42 +0000
treeherdermozilla-release@d33428174ff1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone31.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Add a comment to WeakPtr.h which explicitly calls out the fact that it's not thread-safe, no bug, DONTBUILD
mfbt/WeakPtr.h
--- a/mfbt/WeakPtr.h
+++ b/mfbt/WeakPtr.h
@@ -9,16 +9,18 @@
 /**
  * SupportsWeakPtr lets you have a pointer to an object 'Foo' without affecting
  * its lifetime. It works by creating a single shared reference counted object
  * (WeakReference) that each WeakPtr will access 'Foo' through. This lets 'Foo'
  * clear the pointer in the WeakReference without having to know about all of
  * the WeakPtrs to it and allows the WeakReference to live beyond the lifetime
  * of 'Foo'.
  *
+ * PLEASE NOTE: This weak pointer implementation is not thread-safe.
+ *
  * Note that when deriving from SupportsWeakPtr you should add
  * MOZ_DECLARE_REFCOUNTED_TYPENAME(ClassName) to the public section of your
  * class, where ClassName is the name of your class.
  *
  * The overhead of WeakPtr is that accesses to 'Foo' becomes an additional
  * dereference, and an additional heap allocated pointer sized object shared
  * between all of the WeakPtrs.
  *