Skip to content

Commit 5ea5278

Browse files
otfacebook-github-bot
authored andcommitted
Enforce non-reentrancy of ExecutorLoopController::runLoop()
Summary: `runLoop()` is not supposed to be reentrant, but we never enforced it. After having verified that it is indeed not called re-entrantly, we can make the `loopThread_` check stricter. Reviewed By: Gownta Differential Revision: D52575247 fbshipit-source-id: 6e3da3b132033b7023a336b5b26fb3eb991302f4
1 parent 750a1c4 commit 5ea5278

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

third-party/folly/src/folly/fibers/ExecutorLoopController-inl.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,8 @@ inline void ExecutorLoopController::schedule() {
5252

5353
inline void ExecutorLoopController::runLoop() {
5454
auto oldLoopThread = loopThread_.exchange(std::this_thread::get_id());
55-
DCHECK(
56-
oldLoopThread == std::thread::id{} ||
57-
oldLoopThread == std::this_thread::get_id());
58-
SCOPE_EXIT { loopThread_ = oldLoopThread; };
55+
DCHECK(oldLoopThread == std::thread::id{});
56+
SCOPE_EXIT { loopThread_ = std::thread::id{}; };
5957

6058
if (!executorKeepAlive_) {
6159
if (!fm_->hasTasks()) {

0 commit comments

Comments
 (0)