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.
This commit is contained in:
parent
5e081de14a
commit
9324fbf921
@ -26,7 +26,6 @@ EventThread::Start()
|
||||
{
|
||||
assert(!thread.IsDefined());
|
||||
|
||||
const std::lock_guard<Mutex> 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();
|
||||
};
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user