[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:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -146,7 +146,7 @@ private:
|
||||
void process();
|
||||
|
||||
Queue queue;
|
||||
std::recursive_mutex mutex;
|
||||
std::mutex mutex;
|
||||
uv::async async;
|
||||
|
||||
static uv::tls<RunLoop> current;
|
||||
|
||||
Reference in New Issue
Block a user