Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-1431

Document thread safety for mongoc_client_pool functions

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Trivial - P5 Trivial - P5
    • 1.6.0
    • Affects Version/s: None
    • Component/s: Docs
    • None

      The docs for mongoc_client_pool_set_apm_callbacks say:

      This function can only be called once on a pool, and must be called before the first mongoc_client_pool_pop.

      There's no check for whether or not a client has been popped already in this function, so I think we should add that.

      This might also be kind of a silly point, but I think this function should lock the client pool mutex, or (maybe) be described as "not thread safe" in the docs. In reality I'm sure nobody calls this function from multiple threads, but if someone did, the behavior would be weird.

      mongoc_client_pool_set_error_api should probably lock the pool's mutex or be described as "not thread safe" in the docs as well. I'm guessing nobody actually calls this from multiple threads either, so I don't think it's a "real" bug, but it does look a bit strange.

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            ian.boros@mongodb.com Ian Boros
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: