Release a lock on a resource Arguments: None Returns: None Note this operation terminates execution if the current thread is trying to unlock a resource that is locked by another thread or not locked at all
| Return Type | Function name | Arguments |
|---|---|---|
| void | hzLockS::Unlock | (void) |
Declared in file: hzLock.h
Defined in file : hzLock.cpp
Function Logic:
Function body:
void hzLockS::Unlock (void)
{
// Release a lock on a resource
//
// Arguments: None
// Returns: None
//
// Note this operation terminates execution if the current thread is trying to unlock a resource that is locked by another thread or not locked at all
uint32_t tid ; // Caller thread id
if (_hzGlobal_MT)
{
tid = pthread_self() ;
if (!m_lockval)
Fatal("Attempt by thread %u to unlock address %p that is not locked by any thread", tid, &m_lockval) ;
if (m_lockval == 0xffffffff)
Fatal("hzLockS::hzKill. Attempt by thread %u to unlock a deprected lock\n", tid) ;
if (m_lockval != tid)
Fatal("Attempt by thread %u to unlock address %p that is locked by another thread (%u)", tid, &m_lockval, m_lockval) ;
m_lockval = 0;
}
}