summaryrefslogtreecommitdiff
path: root/sys/opencrypto
diff options
context:
space:
mode:
authorPawel Jakub Dawidek <pjd@FreeBSD.org>2006-05-22 09:58:34 +0000
committerPawel Jakub Dawidek <pjd@FreeBSD.org>2006-05-22 09:58:34 +0000
commit9c12ca29d6ec66768db16f2b7ff32198a623ce89 (patch)
tree642877458b958fa6190fd389a89f315e8622bb46 /sys/opencrypto
parent04d8f36a4fa68591d45d2d12b260cb0b9668302c (diff)
Notes
Diffstat (limited to 'sys/opencrypto')
-rw-r--r--sys/opencrypto/crypto.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/opencrypto/crypto.c b/sys/opencrypto/crypto.c
index 36e32a7c576b..bd3e578e3841 100644
--- a/sys/opencrypto/crypto.c
+++ b/sys/opencrypto/crypto.c
@@ -79,6 +79,7 @@ static TAILQ_HEAD(,cryptkop) crp_ret_kq;
static struct mtx crypto_ret_q_mtx;
#define CRYPTO_RETQ_LOCK() mtx_lock(&crypto_ret_q_mtx)
#define CRYPTO_RETQ_UNLOCK() mtx_unlock(&crypto_ret_q_mtx)
+#define CRYPTO_RETQ_EMPTY() (TAILQ_EMPTY(&crp_ret_q) && TAILQ_EMPTY(&crp_ret_kq))
static uma_zone_t cryptop_zone;
static uma_zone_t cryptodesc_zone;
@@ -953,7 +954,7 @@ crypto_done(struct cryptop *crp)
* Normal case; queue the callback for the thread.
*/
CRYPTO_RETQ_LOCK();
- if (TAILQ_EMPTY(&crp_ret_q))
+ if (CRYPTO_RETQ_EMPTY())
wakeup_one(&crp_ret_q); /* shared wait channel */
TAILQ_INSERT_TAIL(&crp_ret_q, crp, crp_next);
CRYPTO_RETQ_UNLOCK();
@@ -981,7 +982,7 @@ crypto_kdone(struct cryptkop *krp)
}
CRYPTO_DRIVER_UNLOCK();
CRYPTO_RETQ_LOCK();
- if (TAILQ_EMPTY(&crp_ret_kq))
+ if (CRYPTO_RETQ_EMPTY())
wakeup_one(&crp_ret_q); /* shared wait channel */
TAILQ_INSERT_TAIL(&crp_ret_kq, krp, krp_next);
CRYPTO_RETQ_UNLOCK();