From: Kefu Chai Date: Wed, 24 Feb 2021 04:33:33 +0000 (+0800) Subject: async/PosixStack: do not reference worker id in ctor X-Git-Tag: v16.2.15~8^2~8 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=f897a8b26a8ae26836871bf2d35cda02531d702a;p=ceph.git async/PosixStack: do not reference worker id in ctor as it's not needed and confusing. Signed-off-by: Kefu Chai (cherry picked from commit 892bfa097eaf3e1e83cb3fa2ab4b0161bf987851) --- diff --git a/src/msg/async/PosixStack.h b/src/msg/async/PosixStack.h index a7e2f249cafe5..fba45c06bd6f4 100644 --- a/src/msg/async/PosixStack.h +++ b/src/msg/async/PosixStack.h @@ -48,8 +48,7 @@ class PosixNetworkStack : public NetworkStack { explicit PosixNetworkStack(CephContext *c); void spawn_worker(unsigned i, std::function &&func) override { - threads.resize(i+1); - threads[i] = std::thread(func); + threads.emplace_back(std::move(func)); } void join_worker(unsigned i) override { ceph_assert(threads.size() > i && threads[i].joinable());