workqueue: reset heartbeat timeout under lock

This makes coverity happier:

CID 727967: Value not atomically updated (ATOMICITY)
At (44): Using an unreliable value of "hb" inside the second locked section. If the data that "hb" depends on was changed by another thread, this use might be incorrect.

Signed-off-by: Sage Weil <sage@inktank.com>
This commit is contained in:
Sage Weil 2012-09-27 17:55:28 -07:00
parent bdadc4eca6
commit 73d854975e

View File

@ -107,8 +107,8 @@ void ThreadPool::worker(WorkThread *wt)
if (item) {
processing++;
ldout(cct,12) << "worker wq " << wq->name << " start processing " << item << dendl;
_lock.Unlock();
cct->get_heartbeat_map()->reset_timeout(hb, wq->timeout_interval, wq->suicide_interval);
_lock.Unlock();
wq->_void_process(item);
_lock.Lock();
wq->_void_process_finish(item);