summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-02-01 15:51:23 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-02-01 15:51:31 +0300
commitc55bee1961b51c61266e38eda13132e0ef7ae11a (patch)
tree0c5242d4adb9e8427895cdc775ff5f6295d691e6 /include
parenta27c3e002e6e5951219e25ecc9662026d1f6fc47 (diff)
attempt to fix #2139
Diffstat (limited to 'include')
-rw-r--r--include/m_system_cpp.h16
1 files changed, 7 insertions, 9 deletions
diff --git a/include/m_system_cpp.h b/include/m_system_cpp.h
index 9099128224..a65aa9fba4 100644
--- a/include/m_system_cpp.h
+++ b/include/m_system_cpp.h
@@ -39,9 +39,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
///////////////////////////////////////////////////////////////////////////////
// general lists' templates
-struct MNonCopyable
+struct MIR_CORE_EXPORT MNonCopyable
{
- MNonCopyable() {}
+ __inline MNonCopyable() {}
MNonCopyable(const MNonCopyable&) = delete;
MNonCopyable& operator=(const MNonCopyable&) = delete;
@@ -73,18 +73,16 @@ typedef mir_ptr<wchar_t> ptrW;
///////////////////////////////////////////////////////////////////////////////
// mir_cs - simple wrapper for the critical sections
-class mir_cs
+class MIR_CORE_EXPORT mir_cs : public MNonCopyable
{
CRITICAL_SECTION m_cs;
public:
- __inline mir_cs() { ::InitializeCriticalSection(&m_cs); }
- __inline ~mir_cs() { ::DeleteCriticalSection(&m_cs); }
+ mir_cs();
+ ~mir_cs();
- __inline void Lock() { ::EnterCriticalSection(&m_cs); }
- __inline void Unlock() { ::LeaveCriticalSection(&m_cs); }
-
- __inline operator CRITICAL_SECTION&() { return m_cs; }
+ void Lock();
+ void Unlock();
};
///////////////////////////////////////////////////////////////////////////////