Add some traces for app::Document locks

This commit is contained in:
David Capello 2015-04-08 21:48:12 -03:00
parent 7646f118d1
commit d8d0d5f0b1

View File

@ -523,12 +523,15 @@ bool Document::lock(LockType lockType)
if (m_read_locks == 0 && !m_write_lock) {
// We can start writting the sprite...
m_write_lock = true;
TRACE("Document::lock: Locked <%d> to write\n", id());
return true;
}
break;
}
TRACE("Document::lock: Cannot lock <%d> to %s (has %d read locks and %d write locks)\n",
id(), (lockType == ReadLock ? "read": "write"), m_read_locks, m_write_lock);
return false;
}
@ -541,10 +544,14 @@ bool Document::lockToWrite()
ASSERT(!m_write_lock);
m_read_locks = 0;
m_write_lock = true;
TRACE("Document::lockToWrite: Locked <%d> to write\n", id());
return true;
}
else
else {
TRACE("Document::lockToWrite: Cannot lock <%d> to write (has %d read locks and %d write locks)\n",
id(), m_read_locks, m_write_lock);
return false;
}
}
void Document::unlockToRead()