librados/AioCompletionImpl.h: add missing Lock

Add missing Lock around code changing AioCompletionImpl::rval/ack and safe
in C_AioCompleteAndSafe::finish().

CID 1019565 (#1 of 1): Data race condition (MISSING_LOCK)
  missing_lock: Accessing "this->c->rval" ("_ZN8librados17AioCompletionImplE.rval")
  requires the "Mutex._m" lock.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
This commit is contained in:
Danny Al-Gaaf 2013-05-14 18:50:09 +02:00
parent 8a52350dd8
commit 088455f85e

View File

@ -212,9 +212,11 @@ struct C_AioCompleteAndSafe : public Context {
}
void finish(int r) {
c->lock.Lock();
c->rval = r;
c->ack = true;
c->safe = true;
c->lock.Unlock();
rados_callback_t cb_complete = c->callback_complete;
void *cb_arg = c->callback_arg;
if (cb_complete)