[core] Use std::mutex on RunLoop

Only the WorkTask mutex needs to be recusive because
the WorkQueue will run a WorkTask that will pop
itself from the WorkQueue causing it to get cancelled.
This commit is contained in:
Thiago Marcos P. Santos
2015-11-16 21:06:18 +02:00
parent 42a60a6661
commit d9f10fbfa7
2 changed files with 2 additions and 2 deletions

View File

@@ -15,7 +15,7 @@ RunLoop::~RunLoop() {
}
void RunLoop::withMutex(std::function<void()>&& fn) {
std::lock_guard<std::recursive_mutex> lock(mutex);
std::lock_guard<std::mutex> lock(mutex);
fn();
}

View File

@@ -146,7 +146,7 @@ private:
void process();
Queue queue;
std::recursive_mutex mutex;
std::mutex mutex;
uv::async async;
static uv::tls<RunLoop> current;