|
#ifndef _LOCKFREESCOPEDLOCK__H
#define _LOCKFREESCOPEDLOCK__H
#include "SpinLock.h"
namespace LockFree
{
class tScopedLock
{
public:
tScopedLock(tSpinLock &LockObj):m_LockObj(LockObj)
{
m_SpinWaitLock.Lock(m_LockObj);
}
~tScopedLock()
{
m_SpinWaitLock.Unlock(m_LockObj);
}
private:
tSpinLock &m_LockObj;
tSpinWait m_SpinWaitLock;
private:
tScopedLock(const tScopedLock&);
tScopedLock& operator=(const tScopedLock&);
};
};
#endif //_LOCKFREESCOPEDLOCK__H
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Studied MSc Network and Parallel computing from Reading University, UK. I was always interested in IT. Previously worked in Network-Security, Games Development, Satellite Communications and now in Financial Services industry. After work, usually time spent with my son. Love playing cricket, badminton - though not happening much on sports these days. OK, enough about me.
Email: sameer_87@hotmail.com