Skip to content

CDRIVER-3391 Document fork safety #1433

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/libmongoc/doc/mongoc_client_session_t.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ Synopsis

.. include:: includes/session-lifecycle.txt

Fork Safety
-----------
A :symbol:`mongoc_client_session_t` is only usable in the parent process after a fork. The child process must call :symbol:`mongo_client_reset` on the ``client`` field.

Example
-------

Expand Down
4 changes: 4 additions & 0 deletions src/libmongoc/doc/mongoc_client_t.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ Thread Safety

``mongoc_client_t`` is *NOT* thread-safe and should only be used from one thread at a time. When used in multi-threaded scenarios, it is recommended that you use the thread-safe :symbol:`mongoc_client_pool_t` to retrieve a ``mongoc_client_t`` for your thread.

Fork Safety
-----------
A :symbol:`mongoc_client_t` is only usable in the parent process after a fork. The child process must call :symbol:`mongoc_client_reset`.

Example
-------

Expand Down