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

Side by Side Diff: src/engine/Debug.cpp

Issue 11012013: Hanging resolved (critical sections unlocking) (Closed)
Patch Set: Comments addressed Created June 25, 2013, 11:56 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/plugin/PluginFilter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include <fstream> 1 #include <fstream>
2 #include <stdio.h> 2 #include <stdio.h>
3 #include <sstream> 3 #include <sstream>
4 #include <Windows.h> 4 #include <Windows.h>
5 5
6 #include "../shared/Utils.h" 6 #include "../shared/Utils.h"
7 #include "../shared/CriticalSection.h"
7 8
8 #include "Debug.h" 9 #include "Debug.h"
9 10
10 #ifdef _DEBUG 11 #ifdef _DEBUG
11 12
12 CriticalSection debugLock; 13 namespace
13 14 {
15 CriticalSection debugLock;
16 };
14 void Debug(const std::string& text) 17 void Debug(const std::string& text)
15 { 18 {
16 SYSTEMTIME st; 19 SYSTEMTIME st;
17 ::GetSystemTime(&st); 20 ::GetSystemTime(&st);
18 21
19 char timeBuf[14]; 22 char timeBuf[14];
20 _snprintf_s(timeBuf, _TRUNCATE, "%02i:%02i:%02i.%03i", st.wHour, st.wMinute, s t.wSecond, st.wMilliseconds); 23 _snprintf_s(timeBuf, _TRUNCATE, "%02i:%02i:%02i.%03i", st.wHour, st.wMinute, s t.wSecond, st.wMilliseconds);
21 24
22 std::wstring filePath = GetAppDataPath() + L"\\debug_engine.txt"; 25 std::wstring filePath = GetAppDataPath() + L"\\debug_engine.txt";
23 26
(...skipping 12 matching lines...) Expand all
36 39
37 void DebugException(const std::exception& exception) 40 void DebugException(const std::exception& exception)
38 { 41 {
39 Debug(std::string("An exception occurred: ") + exception.what()); 42 Debug(std::string("An exception occurred: ") + exception.what());
40 } 43 }
41 #else 44 #else
42 void Debug(const std::string& text) {} 45 void Debug(const std::string& text) {}
43 void DebugLastError(const std::string& message) {} 46 void DebugLastError(const std::string& message) {}
44 void DebugException(const std::exception& exception) {} 47 void DebugException(const std::exception& exception) {}
45 #endif // _DEBUG 48 #endif // _DEBUG
OLDNEW
« no previous file with comments | « no previous file | src/plugin/PluginFilter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld