Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/engine/Debug.cpp

Issue 11012013: Hanging resolved (critical sections unlocking) (Closed)
Patch Set: Using CriticalSection class instead Created June 17, 2013, 10:03 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/plugin/PluginFilter.h » ('j') | src/plugin/PluginFilter.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/engine/Debug.cpp
===================================================================
--- a/src/engine/Debug.cpp
+++ b/src/engine/Debug.cpp
@@ -9,47 +9,7 @@
#ifdef _DEBUG
-namespace
-{
- class CriticalSection
- {
- public:
- CriticalSection()
- {
- InitializeCriticalSection(&section);
- }
-
- ~CriticalSection()
- {
- DeleteCriticalSection(&section);
- }
-
- class Lock
- {
- public:
- Lock(CriticalSection& cs)
- : section(&cs.section)
- {
- EnterCriticalSection(section);
- }
-
- ~Lock()
- {
- LeaveCriticalSection(section);
- }
- private:
- LPCRITICAL_SECTION section;
- Lock(const Lock&);
- Lock& operator=(const Lock&);
- };
- private:
- CRITICAL_SECTION section;
- CriticalSection(const CriticalSection&);
- CriticalSection& operator=(const CriticalSection&);
- };
-
- CriticalSection debugLock;
-}
+CriticalSection debugLock;
Wladimir Palant 2013/06/17 12:57:24 IMHO this should be kept inside the anonymous name
void Debug(const std::string& text)
{
« no previous file with comments | « no previous file | src/plugin/PluginFilter.h » ('j') | src/plugin/PluginFilter.h » ('J')

Powered by Google App Engine
This is Rietveld