title: MongoDB C++: Is mongocxx::pool thread safe?
body: <p>Do I have to manually lock mongocxx::pool while acquiring a connection?</p>
  
  <p>i.e Is this safe? (example copied from Mongo website)</p>
  
  <pre><code>mongocxx::instance instance{};
  mongocxx::pool pool {mongocxx::uri{}};
  
  using mongocxx::pool::entry = std::unique_ptr&lt;client, std::function&lt;void (client*)&gt;&gt;
  
  auto threadfunc = [](mongocxx::client &amp;client, stdx::string_view dbname) {
      client[dbname]["col"].insert({});
  }
  // don't even bother sharing clients. Just give each thread its own,
  std::thread([]() {
      // pool.acquire() returns a mongo::pool::entry type
      mongocxx::client *c= pool.acquire().get();
      threadfunc(*c, "db1");
      threadfunc(*c, "db2");
  });
  
  std::thread([]() {
      mongocxx::client *c = pool.acquire().get();;
      threadfunc(*c, "db2");
      threadfunc(*c, "db1");
  });
  </code></pre>