My all time favourite C++ Class
class Guard {
public:
Guard(NdbMutex *mtx) : m_mtx(mtx) { NdbMutex_Lock(m_mtx); };
Guard(NdbLockable & l) : m_mtx(l.m_mutex) { NdbMutex_Lock(m_mtx);
};
~Guard() { NdbMutex_Unlock(m_mtx); };
private:
NdbMutex *m_mtx;
};
Tags: c++, code, mutex, mysql
This entry was posted
on Thursday, November 2nd, 2006 at 9:54 pm and is filed under mysql.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.