Releases a lock on a resource but instead of leaving the lock free (a value of 0), it sets the lock to invalid (a value of 0xffffffff). This signals to any thread waiting on the lock, that it must abandon the intended operation on the resource protected by the lock. Kill is called where the resourse is about to be deleted. 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::Kill | (void) |
Declared in file: hzLock.h
Defined in file : hzLock.cpp
Function Logic:
Function body:
void hzLockS::Kill (void)
{
// Releases a lock on a resource but instead of leaving the lock free (a value of 0), it sets the lock to invalid (a value of 0xffffffff). This signals to
// any thread waiting on the lock, that it must abandon the intended operation on the resource protected by the lock. Kill is called where the resourse is
// about to be deleted.
//
// 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("hzLockS::hzKill. Attempt by thread %u to kill unaquired lock\n", tid) ;
if (m_lockval == 0xffffffff)
Fatal("hzLockS::hzKill. Attempt by thread %u to kill a deprecated lock\n", tid) ;
if (m_lockval != tid)
Fatal("hzLockS::hzKill. Attempt by thread %u to kill lock aquired by thread (%u)\n", tid, m_lockval) ;
m_lockval = 0xffffffff;
}
}