Store LockEvent type as an enum class.

This commit is contained in:
Bartosz Taudul 2017-12-10 22:37:56 +01:00
parent bcf2bf1c5c
commit 398eecbb94
2 changed files with 8 additions and 8 deletions

View File

@ -107,7 +107,7 @@ struct LockEvent
int32_t srcloc; int32_t srcloc;
uint8_t thread; uint8_t thread;
uint8_t lockingThread; uint8_t lockingThread;
uint8_t type; Type type;
uint8_t lockCount; uint8_t lockCount;
uint64_t waitList; uint64_t waitList;
}; };

View File

@ -753,7 +753,7 @@ void View::ProcessLockWait( const QueueLockWait& ev )
{ {
auto lev = m_slab.Alloc<LockEvent>(); auto lev = m_slab.Alloc<LockEvent>();
lev->time = ev.time * m_timerMul; lev->time = ev.time * m_timerMul;
lev->type = (uint8_t)LockEvent::Type::Wait; lev->type = LockEvent::Type::Wait;
lev->srcloc = 0; lev->srcloc = 0;
auto it = m_lockMap.find( ev.id ); auto it = m_lockMap.find( ev.id );
@ -771,7 +771,7 @@ void View::ProcessLockObtain( const QueueLockObtain& ev )
{ {
auto lev = m_slab.Alloc<LockEvent>(); auto lev = m_slab.Alloc<LockEvent>();
lev->time = ev.time * m_timerMul; lev->time = ev.time * m_timerMul;
lev->type = (uint8_t)LockEvent::Type::Obtain; lev->type = LockEvent::Type::Obtain;
lev->srcloc = 0; lev->srcloc = 0;
assert( m_lockMap.find( ev.id ) != m_lockMap.end() ); assert( m_lockMap.find( ev.id ) != m_lockMap.end() );
@ -782,7 +782,7 @@ void View::ProcessLockRelease( const QueueLockRelease& ev )
{ {
auto lev = m_slab.Alloc<LockEvent>(); auto lev = m_slab.Alloc<LockEvent>();
lev->time = ev.time * m_timerMul; lev->time = ev.time * m_timerMul;
lev->type = (uint8_t)LockEvent::Type::Release; lev->type = LockEvent::Type::Release;
lev->srcloc = 0; lev->srcloc = 0;
assert( m_lockMap.find( ev.id ) != m_lockMap.end() ); assert( m_lockMap.find( ev.id ) != m_lockMap.end() );
@ -793,7 +793,7 @@ void View::ProcessLockSharedWait( const QueueLockWait& ev )
{ {
auto lev = m_slab.Alloc<LockEvent>(); auto lev = m_slab.Alloc<LockEvent>();
lev->time = ev.time * m_timerMul; lev->time = ev.time * m_timerMul;
lev->type = (uint8_t)LockEvent::Type::Wait; lev->type = LockEvent::Type::Wait;
lev->srcloc = 0; lev->srcloc = 0;
auto it = m_lockMap.find( ev.id ); auto it = m_lockMap.find( ev.id );
@ -811,7 +811,7 @@ void View::ProcessLockSharedObtain( const QueueLockObtain& ev )
{ {
auto lev = m_slab.Alloc<LockEvent>(); auto lev = m_slab.Alloc<LockEvent>();
lev->time = ev.time * m_timerMul; lev->time = ev.time * m_timerMul;
lev->type = (uint8_t)LockEvent::Type::Obtain; lev->type = LockEvent::Type::Obtain;
lev->srcloc = 0; lev->srcloc = 0;
assert( m_lockMap.find( ev.id ) != m_lockMap.end() ); assert( m_lockMap.find( ev.id ) != m_lockMap.end() );
@ -822,7 +822,7 @@ void View::ProcessLockSharedRelease( const QueueLockRelease& ev )
{ {
auto lev = m_slab.Alloc<LockEvent>(); auto lev = m_slab.Alloc<LockEvent>();
lev->time = ev.time * m_timerMul; lev->time = ev.time * m_timerMul;
lev->type = (uint8_t)LockEvent::Type::Release; lev->type = LockEvent::Type::Release;
lev->srcloc = 0; lev->srcloc = 0;
assert( m_lockMap.find( ev.id ) != m_lockMap.end() ); assert( m_lockMap.find( ev.id ) != m_lockMap.end() );
@ -844,7 +844,7 @@ void View::ProcessLockMark( const QueueLockMark& ev )
--it; --it;
if( (*it)->thread == thread ) if( (*it)->thread == thread )
{ {
switch( (LockEvent::Type)(*it)->type ) switch( (*it)->type )
{ {
case LockEvent::Type::Obtain: case LockEvent::Type::Obtain:
case LockEvent::Type::Wait: case LockEvent::Type::Wait: