You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
612 B
44 lines
612 B
//
|
|
// ciccs.h
|
|
//
|
|
|
|
|
|
#ifndef CICCS_H
|
|
#define CICCS_H
|
|
|
|
|
|
|
|
class CCicCriticalSectionStatic
|
|
{
|
|
public:
|
|
BOOL Init()
|
|
{
|
|
m_fInit = FALSE;
|
|
if (InitializeCriticalSectionAndSpinCount(&m_cs, 0))
|
|
{
|
|
m_fInit = TRUE;
|
|
}
|
|
|
|
return m_fInit;
|
|
}
|
|
|
|
void Delete()
|
|
{
|
|
if (m_fInit)
|
|
{
|
|
DeleteCriticalSection(&m_cs);
|
|
m_fInit = FALSE;
|
|
}
|
|
}
|
|
|
|
operator CRITICAL_SECTION*()
|
|
{
|
|
return &m_cs;
|
|
}
|
|
|
|
private:
|
|
CRITICAL_SECTION m_cs;
|
|
BOOL m_fInit;
|
|
};
|
|
|
|
#endif CICCS_H
|