1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-09-01 18:04:05 +02:00

* Updated breakpad to latest version.

This commit is contained in:
Christian Muehlhaeuser
2012-06-24 18:25:34 +02:00
parent 0a3a9a7e97
commit d3eb5c3f88
186 changed files with 9184 additions and 5835 deletions

View File

@@ -40,13 +40,30 @@ class AutoCriticalSection {
public:
// Creates a new instance with the given critical section object
// and enters the critical section immediately.
explicit AutoCriticalSection(CRITICAL_SECTION* cs) : cs_(cs) {
explicit AutoCriticalSection(CRITICAL_SECTION* cs) : cs_(cs), taken_(false) {
assert(cs_);
EnterCriticalSection(cs_);
Acquire();
}
// Destructor: leaves the critical section.
~AutoCriticalSection() {
if (taken_) {
Release();
}
}
// Enters the critical section. Recursive Acquire() calls are not allowed.
void Acquire() {
assert(!taken_);
EnterCriticalSection(cs_);
taken_ = true;
}
// Leaves the critical section. The caller should not call Release() unless
// the critical seciton has been entered already.
void Release() {
assert(taken_);
taken_ = false;
LeaveCriticalSection(cs_);
}
@@ -56,6 +73,7 @@ class AutoCriticalSection {
AutoCriticalSection& operator=(const AutoCriticalSection&);
CRITICAL_SECTION* cs_;
bool taken_;
};
} // namespace google_breakpad