Skip to content

Commit 6fee88b

Browse files
authored
Document fork safety (#1433)
1 parent c7fa88c commit 6fee88b

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/libmongoc/doc/mongoc_client_session_t.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ Synopsis
1111

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

14+
Fork Safety
15+
-----------
16+
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.
17+
1418
Example
1519
-------
1620

src/libmongoc/doc/mongoc_client_t.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ Thread Safety
3232

3333
``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.
3434

35+
Fork Safety
36+
-----------
37+
A :symbol:`mongoc_client_t` is only usable in the parent process after a fork. The child process must call :symbol:`mongoc_client_reset`.
38+
3539
Example
3640
-------
3741

0 commit comments

Comments
 (0)