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

Side by Side Diff: src/shared/CriticalSection.h

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 | « src/plugin/PluginFilter.cpp ('k') | src/shared/Utils.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #ifndef CRITICAL_SECTION_H
2 #define CRITICAL_SECTION_H
3
4 class CriticalSection
5 {
6 public:
7 CriticalSection()
8 {
9 InitializeCriticalSection(&section);
10 }
11
12 ~CriticalSection()
13 {
14 DeleteCriticalSection(&section);
15 }
16
17 class Lock
18 {
19 public:
20 Lock(CriticalSection& cs)
21 : section(&cs.section)
22 {
23 EnterCriticalSection(section);
24 }
25
26 ~Lock()
27 {
28 LeaveCriticalSection(section);
29 }
30 private:
31 LPCRITICAL_SECTION section;
32 Lock(const Lock&);
33 Lock& operator=(const Lock&);
34 };
35 private:
36 CRITICAL_SECTION section;
37 CriticalSection(const CriticalSection&);
38 CriticalSection& operator=(const CriticalSection&);
39 };
40 #endif
OLDNEW
« no previous file with comments | « src/plugin/PluginFilter.cpp ('k') | src/shared/Utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld