SYNOPSIS

#include <bson.h>

typedef enum
{
   BSON_CONTEXT_NONE               = 0,
   BSON_CONTEXT_THREAD_SAFE        = (1 << 0),
   BSON_CONTEXT_DISABLE_HOST_CACHE = (1 << 1),
   BSON_CONTEXT_DISABLE_PID_CACHE  = (1 << 2),
#if defined(__linux__)
   BSON_CONTEXT_USE_TASK_ID        = (1 << 3),
#endif
} bson_context_flags_t;

bson_context_t *
bson_context_new (bson_context_flags_t flags);

DESCRIPTION

This is primarily useful if the default bson_context_t is insufficient for your purposes.

The bson_context_new() function shall create a new bson_context_t based on the flags provided. Based on your needs, you can get better performance or more correctness in OID generation using a custom bson_context_t.

RETURN VALUE

A newly allocated bson_context_t that should be freed with bson_context_destroy().

ERRORS

No errors are defined.

AUTHORS

This page was written by MongoDB, Inc.