From 9324fbf92174480071f3e5e87c1e45653812f9f2 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 10 Feb 2017 22:29:31 +0100 Subject: [PATCH] event/Thread: remove the Mutex We don't need to access Thread::handle early inside the EventThread, so we don't need this trick anymore. --- src/event/Thread.cxx | 6 ------ src/event/Thread.hxx | 3 --- 2 files changed, 9 deletions(-) diff --git a/src/event/Thread.cxx b/src/event/Thread.cxx index aead6636c..e5c8ed0bc 100644 --- a/src/event/Thread.cxx +++ b/src/event/Thread.cxx @@ -26,7 +26,6 @@ EventThread::Start() { assert(!thread.IsDefined()); - const std::lock_guard protect(mutex); thread.Start(ThreadFunc, this); } @@ -44,11 +43,6 @@ EventThread::ThreadFunc() { SetThreadName("io"); - /* lock+unlock to synchronize with io_thread_start(), to be - sure that io.thread is set */ - mutex.lock(); - mutex.unlock(); - event_loop.Run(); }; diff --git a/src/event/Thread.hxx b/src/event/Thread.hxx index 3484bd44e..737740825 100644 --- a/src/event/Thread.hxx +++ b/src/event/Thread.hxx @@ -23,14 +23,11 @@ #include "check.h" #include "Loop.hxx" #include "thread/Thread.hxx" -#include "thread/Mutex.hxx" /** * A thread which runs an #EventLoop. */ class EventThread final { - Mutex mutex; - EventLoop event_loop; Thread thread;