X509_STORE_CTX_get_obj_by_subject() is like X509_STORE_CTX_get_by_subject()
but returns the found object on success, else NULL.
+=head1 NOTES
+
+These functions are safe to use in a multithreaded environment and with
+lookup functions on the same store.
+
+Applications sharing a store across threads should manage its lifetime with
+L<X509_STORE_up_ref(3)> and L<X509_STORE_free(3)>, and must ensure that
+all lookup operations have completed before the store is freed. See
+L<X509_STORE_new(3)/Thread Safety> for more discussion of the B<X509_STORE> threading
+model.
+
=head1 RETURN VALUES
X509_STORE_CTX_get_by_subject() returns 1 if the lookup was successful, else 0.
=head1 SEE ALSO
L<X509_LOOKUP_meth_set_get_by_subject(3)>,
-L<X509_LOOKUP_by_subject(3)>
+L<X509_LOOKUP_by_subject(3)>,
+L<X509_STORE_new(3)>
=head1 COPYRIGHT
X509_STORE_up_ref() increments the reference count associated with the
X509_STORE object.
-X509_STORE_lock() locks the store from modification by other threads,
-X509_STORE_unlock() unlocks it.
+X509_STORE_lock() locks the store from reads and writes by other threads,
+and X509_STORE_unlock() unlocks it. Not all operations require locking
+the store, see the notes on thread safety below.
-X509_STORE_free() frees up a single X509_STORE object.
+X509_STORE_free() decrements the reference count of the X509_STORE object.
+The store's memory is only freed when its reference count drops to
+zero.
If the argument is NULL, nothing is done.
+=head1 NOTES
+
+=head2 Thread Safety
+
+When an B<X509_STORE> is shared across multiple threads, each thread or
+component that holds a pointer to it should call X509_STORE_up_ref() to
+acquire a reference, and release the reference with X509_STORE_free() when
+done.
+
+Adding certificates or CRLs, for example L<X509_STORE_add_cert(3)> or
+L<X509_STORE_add_crl(3)>, as well as looking up objects from the cache
+with L<X509_STORE_CTX_get_by_subject(3)> are safe to call concurrently
+from multiple threads on the same store without external synchronization,
+provided the ownership to the X509_STORE is obtained by acquiring a
+reference in advance.
+
+Store I<configuration> functions (X509_STORE_set_flags(),
+X509_STORE_set_depth(), X509_STORE_set_purpose(), X509_STORE_set_trust(),
+and similar) are B<not> safe to call concurrently with any other operation
+on the same store; the store must be fully configured before being shared
+with other threads.
+
+One useful pattern is having a single owner thread that calls
+X509_STORE_free() only after joining with all threads that use the store.
+
=head1 RETURN VALUES
X509_STORE_new() returns a newly created X509_STORE or NULL if the call fails.