Details
-
Improvement
-
Resolution: Unresolved
-
Minor - P4
-
None
-
None
Description
There's a comment at the top of BSONObj about thread safety that seems out of date.
Note that BSONObj's have a smart pointer capability built in -- so you can
|
pass them around by value. The reference counts used to implement this
|
do not use locking, so copying and destroying BSONObj's are not thread-safe
|
operations.
|
It looks like references are counted via AtomicUInt so the counting seems thread safe. And it looks like the thread safety rules are similar to those for shared_ptr, but it would be good to check that and document.