Commit 9324fbf9 authored by Max Kellermann's avatar Max Kellermann

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.
parent 5e081de1
...@@ -26,7 +26,6 @@ EventThread::Start() ...@@ -26,7 +26,6 @@ EventThread::Start()
{ {
assert(!thread.IsDefined()); assert(!thread.IsDefined());
const std::lock_guard<Mutex> protect(mutex);
thread.Start(ThreadFunc, this); thread.Start(ThreadFunc, this);
} }
...@@ -44,11 +43,6 @@ EventThread::ThreadFunc() ...@@ -44,11 +43,6 @@ EventThread::ThreadFunc()
{ {
SetThreadName("io"); 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(); event_loop.Run();
}; };
......
...@@ -23,14 +23,11 @@ ...@@ -23,14 +23,11 @@
#include "check.h" #include "check.h"
#include "Loop.hxx" #include "Loop.hxx"
#include "thread/Thread.hxx" #include "thread/Thread.hxx"
#include "thread/Mutex.hxx"
/** /**
* A thread which runs an #EventLoop. * A thread which runs an #EventLoop.
*/ */
class EventThread final { class EventThread final {
Mutex mutex;
EventLoop event_loop; EventLoop event_loop;
Thread thread; Thread thread;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment