1
0
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:
4ertus2
2024-10-20 23:19:09 +03:00
parent e32731b60b
commit ead82cdba9
4 changed files with 32 additions and 26 deletions

View File

@@ -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();
}