using shared read locks in credential set enumerators to avoid deadlocks

This commit is contained in:
Martin Willi
2008-07-30 11:38:44 +00:00
parent 21632b76e0
commit 38a8e39739
5 changed files with 119 additions and 70 deletions
+7
View File
@@ -36,6 +36,13 @@ typedef struct credential_set_t credential_set_t;
* Enumerators are used because queries might return multiple matches.
* Filter parameters restrict enumeration over specific items only.
* See credential_manager_t for an overview of the credential framework.
*
* A credential set enumerator may not block the credential set, i.e. multiple
* threads must be able to hold multiple enumerators, as the credential manager
* is higly parallelized. The best way to achieve this is by using shared
* read locks for the enumerators only. Otherwiese deadlocks will occur.
* The writing cache_cert() routine is called by the manager only if no
* enumerator is alive, so it is save to use a write lock there.
*/
struct credential_set_t {