1BSON_CONTEXT_NEW(3) Libbson BSON_CONTEXT_NEW(3)
2
3
4
6 bson_context_new - bson_context_new()
7
9 bson_context_t *
10 bson_context_new (bson_context_flags_t flags);
11
13 · flags: A bson_context_flags_t.
14
15 The following flags may be used: * BSON_CONTEXT_NONE meaning creating
16 ObjectIDs with this context is not a thread-safe operation. *
17 BSON_CONTEXT_THREAD_SAFE meaning creating ObjectIDs with this context
18 is a thread-safe operation. * BSON_CONTEXT_DISABLE_PID_CACHE meaning
19 creating ObjectIDs will also check if the process has changed by call‐
20 ing getpid() on every ObjectID generation.
21
22 To use multiple flags, xor them together.
23
25 Creates a new bson_context_t. This is rarely needed as bson_con‐
26 text_get_default() serves most use-cases.
27
29 A newly allocated bson_context_t that should be freed with bson_con‐
30 text_destroy.
31
33 MongoDB, Inc
34
36 2017-present, MongoDB, Inc
37
38
39
40
411.15.2 Nov 06, 2019 BSON_CONTEXT_NEW(3)