diff options
Diffstat (limited to 'src/async/async_worker.c')
-rw-r--r-- | src/async/async_worker.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/async/async_worker.c b/src/async/async_worker.c index 4f372d05d19..6a5ec5feeb0 100644 --- a/src/async/async_worker.c +++ b/src/async/async_worker.c @@ -67,7 +67,7 @@ retry: * a race, try again. */ my_consume = last_consume + 1; - if (!WT_ATOMIC_CAS8(async->alloc_tail, last_consume, my_consume)) + if (!__wt_atomic_cas64(&async->alloc_tail, last_consume, my_consume)) goto retry; /* * This item of work is ours to process. Clear it out of the @@ -81,7 +81,7 @@ retry: WT_ASSERT(session, async->cur_queue > 0); WT_ASSERT(session, *op != NULL); WT_ASSERT(session, (*op)->state == WT_ASYNCOP_ENQUEUED); - (void)WT_ATOMIC_SUB4(async->cur_queue, 1); + (void)__wt_atomic_sub32(&async->cur_queue, 1); (*op)->state = WT_ASYNCOP_WORKING; if (*op == &async->flush_op) @@ -135,7 +135,7 @@ __async_worker_cursor(WT_SESSION_IMPL *session, WT_ASYNC_OP_IMPL *op, if (op->optype == WT_AOP_COMPACT) return (0); WT_ASSERT(session, op->format != NULL); - STAILQ_FOREACH(ac, &worker->cursorqh, q) { + TAILQ_FOREACH(ac, &worker->cursorqh, q) { if (op->format->cfg_hash == ac->cfg_hash && op->format->uri_hash == ac->uri_hash) { /* @@ -156,7 +156,7 @@ __async_worker_cursor(WT_SESSION_IMPL *session, WT_ASYNC_OP_IMPL *op, ac->cfg_hash = op->format->cfg_hash; ac->uri_hash = op->format->uri_hash; ac->c = c; - STAILQ_INSERT_HEAD(&worker->cursorqh, ac, q); + TAILQ_INSERT_HEAD(&worker->cursorqh, ac, q); worker->num_cursors++; *cursorp = c; return (0); @@ -297,7 +297,7 @@ __wt_async_worker(void *arg) async = conn->async; worker.num_cursors = 0; - STAILQ_INIT(&worker.cursorqh); + TAILQ_INIT(&worker.cursorqh); while (F_ISSET(conn, WT_CONN_SERVER_ASYNC) && F_ISSET(session, WT_SESSION_SERVER_ASYNC)) { WT_ERR(__async_op_dequeue(conn, session, &op)); @@ -316,7 +316,7 @@ __wt_async_worker(void *arg) * the queue. */ WT_ORDERED_READ(flush_gen, async->flush_gen); - if (WT_ATOMIC_ADD4(async->flush_count, 1) == + if (__wt_atomic_add32(&async->flush_count, 1) == conn->async_workers) { /* * We're last. All workers accounted for so @@ -346,9 +346,9 @@ err: WT_PANIC_MSG(session, ret, "async worker error"); * Worker thread cleanup, close our cached cursors and free all the * WT_ASYNC_CURSOR structures. */ - ac = STAILQ_FIRST(&worker.cursorqh); + ac = TAILQ_FIRST(&worker.cursorqh); while (ac != NULL) { - acnext = STAILQ_NEXT(ac, q); + acnext = TAILQ_NEXT(ac, q); WT_TRET(ac->c->close(ac->c)); __wt_free(session, ac); ac = acnext; |