diff options
Diffstat (limited to 'src/third_party/wiredtiger/src/async/async_op.c')
-rw-r--r-- | src/third_party/wiredtiger/src/async/async_op.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/third_party/wiredtiger/src/async/async_op.c b/src/third_party/wiredtiger/src/async/async_op.c index 86797af635b..d0c58f584cc 100644 --- a/src/third_party/wiredtiger/src/async/async_op.c +++ b/src/third_party/wiredtiger/src/async/async_op.c @@ -267,11 +267,17 @@ __wt_async_op_enqueue(WT_SESSION_IMPL *session, WT_ASYNC_OP_IMPL *op) conn = S2C(session); async = conn->async; + /* - * Enqueue op at the tail of the work queue. + * If an application re-uses a WT_ASYNC_OP, we end up here with an + * invalid object. */ - WT_ASSERT(session, op->state == WT_ASYNCOP_READY); + if (op->state != WT_ASYNCOP_READY) + WT_RET_MSG(session, EINVAL, + "application error: WT_ASYNC_OP already in use"); + /* + * Enqueue op at the tail of the work queue. * We get our slot in the ring buffer to use. */ my_alloc = WT_ATOMIC_ADD8(async->alloc_head, 1); |