Diffusion GnuPG 22e274f839f9

sm: Change keydb code to use the keybox locking.

Authored by werner on May 14 2019, 1:36 PM.

Description

sm: Change keydb code to use the keybox locking.

* kbx/keybox-init.c (keybox_lock): New arg TIMEOUT.  Change all
callers to pass -1 when locking.
* sm/keydb.c (struct resource_item): Remove LOCKANDLE.
(struct keydb_handle): Add KEEP_LOCK.
(keydb_add_resource): Use keybox locking instead of a separate dotlock
for testing whether we can run a compress.
(keydb_release): Reset KEEP_LOCK.
(keydb_lock): Set KEEP_LOCK.
(unlock_all): Take care of KEEP_LOCK.
(lock_all): Use keybox_lock instead of dotlock fucntions.
(keydb_delete): Remove arg UNLOCK.
* sm/delete.c (delete_one): Adjust keydb_delete.  Due to the KEEP_LOCK
the keydb_release takes care of unlocking.

This aligns the code more with g10/keydb.c and avoids the separate
calls to dotlock_take.

  • GnuPG-bug-id: T4505
  • Signed-off-by: Werner Koch <wk@gnupg.org>

Details

Committed
wernerMay 14 2019, 1:36 PM
Parents
rG54e96c6fd262: agent: Replace most assert by log_assert.
Branches
Unknown
Tags
Unknown
Tasks
T4505: SM, W32: GPGSM hangs up the GnuPG System