mirror of
https://github.com/xmrig/xmrig.git
synced 2025-12-13 18:12:50 -05:00
prevent manual mutex lock/unlock
This commit is contained in:
@@ -180,11 +180,11 @@ public:
|
||||
}
|
||||
# endif
|
||||
|
||||
mutex.lock();
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex);
|
||||
|
||||
pages += status.hugePages();
|
||||
|
||||
mutex.unlock();
|
||||
pages += status.hugePages();
|
||||
}
|
||||
|
||||
rapidjson::Value hugepages;
|
||||
|
||||
@@ -380,14 +380,14 @@ void xmrig::CpuBackend::setJob(const Job &job)
|
||||
|
||||
void xmrig::CpuBackend::start(IWorker *worker, bool ready)
|
||||
{
|
||||
mutex.lock();
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex);
|
||||
|
||||
if (d_ptr->status.started(worker, ready)) {
|
||||
d_ptr->status.print();
|
||||
if (d_ptr->status.started(worker, ready)) {
|
||||
d_ptr->status.print();
|
||||
}
|
||||
}
|
||||
|
||||
mutex.unlock();
|
||||
|
||||
if (ready) {
|
||||
worker->start();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user