obj: make the OBJ_ calls thread safe
authorPauli <pauli@openssl.org>
Fri, 11 Jun 2021 07:05:20 +0000 (17:05 +1000)
committerPauli <ppzgs1@gmail.com>
Sat, 25 Sep 2021 00:39:20 +0000 (10:39 +1000)
commit397065c621e733fff80dedb28252120ec143693e
tree50d2712cc0401e80a0397243aee925bc7849564e
parentb0b456f8c8b628c3d7e212339e31cbfd06ac4ec8
obj: make the OBJ_ calls thread safe

This is done using a single global lock.  The premise for this is that new
objects will most frequently be added at start up and never added subsequently.
Thus, the locking will be for read most of the time.

This does, however, introduce the overhead of taking an uncontested read lock
when accessing the object database.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15713)
crypto/objects/obj_dat.c