diff options
author | Eric Wong <normalperson@yhbt.net> | 2013-07-14 00:46:10 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2013-07-14 00:46:10 +0000 |
commit | 8f9b7e28eaf74e5fdc72328f0dfb890d92c02ec1 (patch) | |
tree | cefa17156197096e9973efa6973d924fae737c6d /ioq.c | |
parent | b773c55485a7a50904493a0cdc8dd22da9bbfdee (diff) | |
download | cmogstored-8f9b7e28eaf74e5fdc72328f0dfb890d92c02ec1.tar.gz |
This should avoid concurrency bugs where client may run in multiple threads if we switch to multi-threaded graceful shutdown.
Diffstat (limited to 'ioq.c')
-rw-r--r-- | ioq.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -25,6 +25,18 @@ void mog_ioq_init(struct mog_ioq *ioq, struct mog_svc *svc, size_t val) } /* + * we do not need this, yet, but this will allow us to have multi-threaded + * shutdown in the future (we currently drop into single-threaded mode) + */ +void mog_ioq_requeue_prepare(struct mog_ioq *ioq) +{ + assert(ioq->cur >= ioq->max && + "we should only get here when idle before mog_fdmap_requeue"); + + SIMPLEQ_INIT(&ioq->ioq_head); +} + +/* * this is only a hint, so no explicit memory barriers or atomics */ static inline void ioq_set_contended(struct mog_ioq *ioq) |