diff options
author | Marcus Brinkmann <[email protected]> | 2006-10-23 18:52:14 +0000 |
---|---|---|
committer | Marcus Brinkmann <[email protected]> | 2006-10-23 18:52:14 +0000 |
commit | ebb8edbb30c8d21f2ebc4c398d46616f84859355 (patch) | |
tree | 09e8b73a02829b45852e0d8df82da3a1d4d5544a | |
parent | 2006-10-23 Marcus Brinkmann <[email protected]> (diff) | |
download | gpgme-ebb8edbb30c8d21f2ebc4c398d46616f84859355.tar.gz gpgme-ebb8edbb30c8d21f2ebc4c398d46616f84859355.zip |
2006-10-23 Marcus Brinkmann <[email protected]>
* wait-global.c (gpgme_wait): Unlock CTX_LIST_LOCK while calling
_gpgme_engine_io_event().
-rw-r--r-- | gpgme/ChangeLog | 3 | ||||
-rw-r--r-- | gpgme/wait-global.c | 13 |
2 files changed, 16 insertions, 0 deletions
diff --git a/gpgme/ChangeLog b/gpgme/ChangeLog index 9dce5958..f3b78b5b 100644 --- a/gpgme/ChangeLog +++ b/gpgme/ChangeLog @@ -1,5 +1,8 @@ 2006-10-23 Marcus Brinkmann <[email protected]> + * wait-global.c (gpgme_wait): Unlock CTX_LIST_LOCK while calling + _gpgme_engine_io_event(). + * keylist.c (gpgme_op_keylist_next): Return error if OPD is NULL. 2006-09-25 Marcus Brinkmann <[email protected]> diff --git a/gpgme/wait-global.c b/gpgme/wait-global.c index a6da116e..3b1e3d9a 100644 --- a/gpgme/wait-global.c +++ b/gpgme/wait-global.c @@ -334,6 +334,7 @@ gpgme_wait (gpgme_ctx_t ctx, gpgme_error_t *status, int hang) /* Now some contexts might have finished successfully. */ LOCK (ctx_list_lock); + retry: for (li = ctx_active_list; li; li = li->next) { gpgme_ctx_t actx = li->ctx; @@ -344,7 +345,19 @@ gpgme_wait (gpgme_ctx_t ctx, gpgme_error_t *status, int hang) if (i == actx->fdt.size) { gpgme_error_t err = 0; + + /* FIXME: This does not perform too well. We have to + release the lock because the I/O event handler + acquires it to remove the context from the active + list. Two alternative strategies are worth + considering: Either implement the DONE event handler + here in a lock-free manner, or save a list of all + contexts to be released and call the DONE events + afterwards. */ + UNLOCK (ctx_list_lock); _gpgme_engine_io_event (actx->engine, GPGME_EVENT_DONE, &err); + LOCK (ctx_list_lock); + goto retry; } } UNLOCK (ctx_list_lock); |