mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 17:41:59 +00:00
add a one-line method for resetting a job lock
This commit is contained in:
parent
7a3c21174d
commit
7eb71143db
@ -40,7 +40,7 @@ DeflateJobHWPool::DeflateJobHWPool():log(&Poco::Logger::get("DeflateJobHWPool"))
|
||||
if ((nullptr == qpl_job_ptr) || (qpl_init_job(PATH, qpl_job_ptr) != QPL_STS_OK))
|
||||
break;
|
||||
jobPool[index] = qpl_job_ptr;
|
||||
jobLocks[index].store(false);
|
||||
unLockJob(index);
|
||||
}
|
||||
|
||||
const char * qpl_version = qpl_get_library_version();
|
||||
@ -66,7 +66,7 @@ DeflateJobHWPool::~DeflateJobHWPool()
|
||||
qpl_fini_job(jobPool[i]);
|
||||
}
|
||||
jobPool[i] = nullptr;
|
||||
jobLocks[i].store(false);
|
||||
unLockJob(i);
|
||||
}
|
||||
jobPoolReady() = false;
|
||||
}
|
||||
|
@ -81,6 +81,8 @@ private:
|
||||
return jobLocks[index].compare_exchange_strong(expected, true);
|
||||
}
|
||||
|
||||
void unLockJob(uint32_t index) { jobLocks[index].store(false); }
|
||||
|
||||
class ReleaseJobObjectGuard
|
||||
{
|
||||
uint32_t index;
|
||||
|
Loading…
Reference in New Issue
Block a user