PageRenderTime 4ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/win32/shellext/ShellExt.h

https://bitbucket.org/tortoisehg/hgtk/
C++ Header | 31 lines | 23 code | 8 blank | 0 comment | 0 complexity | 0f0dda5bcd9bde9f844d23ad78c9d498 MD5 | raw file
 1#ifndef _SHELL_EXT_H_
 2#define _SHELL_EXT_H_
 3
 4
 5class CShellExt
 6{
 7public:
 8    static LPCRITICAL_SECTION GetCriticalSection();
 9    static void IncDllRef();
10    static void DecDllRef();
11};
12
13
14class ThgCriticalSection
15{
16    LPCRITICAL_SECTION cs_;
17
18public:
19    ThgCriticalSection(LPCRITICAL_SECTION cs): cs_(cs)
20    {
21        ::EnterCriticalSection(cs_);
22    }
23
24    ~ThgCriticalSection()
25    {
26        ::LeaveCriticalSection(cs_);
27    }
28};
29
30
31#endif // _SHELL_EXT_H_