Kill a lock (signal that the resouce controlled by the lock is to be deleted). The calling thread must hold the write lock. This function will terminate the program if this is not the case or if the lock has already been killed. Arguments: None Returns: None
| Return Type | Function name | Arguments |
|---|---|---|
| void | hzLockRWD::Kill | (void) |
Declared in file: hzLock.h
Defined in file : hzLock.cpp
Function Logic:
Function body:
void hzLockRWD::Kill (void)
{
// Kill a lock (signal that the resouce controlled by the lock is to be deleted). The calling thread must hold the write lock. This function will terminate
// the program if this is not the case or if the lock has already been killed.
//
// Arguments: None
// Returns: None
uint32_t tid ; // Caller thread id
if (_hzGlobal_MT)
{
tid = pthread_self() ;
if (!m_lockval)
Fatal("hzLockRW::hzKill. Attempt by thread %u to kill unaquired lock\n", tid) ;
if (m_lockval == 0xffffffff)
Fatal("hzLockRW::hzKill. Attempt by thread %u to kill a deprecated lock\n", tid) ;
if (m_lockval != tid)
Fatal("hzLockRW::hzKill. Attempt by thread %u to kill lock aquired by thread (%u)\n", tid, m_lockval) ;
m_lockval = 0xffffffff;
}
}