better document thread safety of BSONObj

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Internal Code
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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.

            Assignee:
            DO NOT USE - Backlog - Platform Team
            Reporter:
            Aaron Staple (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: