Erasing Cpp2Worker in its evb thread
authorHaijun Zhu <haijunz@fb.com>
Tue, 1 Sep 2015 23:50:12 +0000 (16:50 -0700)
committerfacebook-github-bot-4 <folly-bot@fb.com>
Wed, 2 Sep 2015 01:20:22 +0000 (18:20 -0700)
commitf119064488072b6a228cdb65e1ac8f1c5f37d2bb
treee1ead5524e9b7b4161aa0cdacb980ba7592dadce
parent076bfa05e0ddbad1777100995be7027f8ab3b5c1
Erasing Cpp2Worker in its evb thread

Summary: Erasing Cpp2Worker happens in acceptor thread but when evb is
destroyed and drains its callback queue, the callbacks may access the
worker. This moves erasing Cpp2Worer to its own evb thread, after all
callbacks are run.

Reviewed By: @yfeldblum

Differential Revision: D2398089
folly/io/async/EventBase.cpp
folly/io/async/EventBase.h