| Return Type | Function name | Arguments |
|---|---|---|
| hzEcode | hzLockRWD::LockRead | (int,) |
Declared in file: hzLock.h
Defined in file : hzLock.cpp
Function Logic:
Function body:
hzEcode hzLockRWD::LockRead (int nTries)
{
_hzfunc("hzLockRWD::LockRead") ;
uint32_t cont ;
uint32_t tid ;
if (!_hzGlobal_MT)
return E_OK ;
tid = pthread_self() ;
if (m_lockval == 0xffffffff)
return E_NOTFOUND ;
if (m_lockval == tid)
Fatal("Attempt by thread %u to re-lock address %p\n", tid, &m_lockval) ;
for (cont = 0; m_lockval ; cont++)
{
if (m_lockval == 0xffffffff)
return E_NOTFOUND ;
if (!m_lockval)
break ;
}
while (__sync_add_and_fetch(&m_counter, 1));
return E_OK ;
}