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

@ -452,16 +452,17 @@ void xmrig::CudaBackend::setJob(const Job &job)
void xmrig::CudaBackend::start(IWorker *worker, bool ready)
{
mutex.lock();
{
std::lock_guard<std::mutex> lock(mutex);
if (d_ptr->status.started(ready)) {
d_ptr->status.print();
if (d_ptr->status.started(ready)) {
d_ptr->status.print();
CudaWorker::ready = true;
}
CudaWorker::ready = true;
}
mutex.unlock();
if (ready) {
worker->start();
}