Threading

Libbson is NOT thread-safe, but it is thread-aware. Libbson requires POSIX threads (pthreads) on all UNIX-like platforms. On Windows, the native threading interface is used.

You, the API consumer, are responsible for managing the data-structures in way that results two threads are not mutating at the same time. You may also want to bear in mind your platform may have ordering and consistency concerns that should also be followed.

Libbson used threading primatives for controlling state internal to the library as well as providing atomic fallbacks during ObjectID generation.