summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2021-11-09 14:32:14 +0000
committerMatt Caswell <matt@openssl.org>2021-11-15 14:22:41 +0000
commit256ec496890da13c700d5a21b069d519fe02c0b2 (patch)
tree2a6cbee3eb479e776482596213882e5ff08d8b2f /doc
parent5ab06d33e6b3be15c8784f1e1fd6c3d845b5cc3a (diff)
Use a write lock during ossl_provider_find()
A "find" operation on a stack can end up sorting the underlying stack. In this case it is necessary to use a "write" lock to synchronise access to the stack across multiple threads. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17018)
Diffstat (limited to 'doc')
-rw-r--r--doc/man3/DEFINE_STACK_OF.pod5
1 files changed, 4 insertions, 1 deletions
diff --git a/doc/man3/DEFINE_STACK_OF.pod b/doc/man3/DEFINE_STACK_OF.pod
index d7152466f4..ec9eda81c6 100644
--- a/doc/man3/DEFINE_STACK_OF.pod
+++ b/doc/man3/DEFINE_STACK_OF.pod
@@ -178,7 +178,10 @@ where a comparison function has been specified, I<sk> is sorted and
B<sk_I<TYPE>_find>() returns the index of a matching element or B<-1> if there
is no match. Note that, in this case the comparison function will usually
compare the values pointed to rather than the pointers themselves and
-the order of elements in I<sk> can change.
+the order of elements in I<sk> can change. Note that because the stack may be
+sorted as the result of a B<sk_I<TYPE>_find>() call, if a lock is being used to
+synchronise access to the stack across multiple threads, then that lock must be
+a "write" lock.
B<sk_I<TYPE>_find_ex>() operates like B<sk_I<TYPE>_find>() except when a
comparison function has been specified and no matching element is found.